Repository navigation
Commit cb71141
committed
fix(provider): strip properties/required from non-object types in Gemini schema
Gemini API rejects tool schemas where 'properties' or 'required' fields
are present on non-object types. This commonly occurs with MCP tools
(e.g., Notion MCP) that define these fields on array or other types.
Error example:
GenerateContentRequest.tools[0].function_declarations[80].parameters.properties[data].properties: only allowed for OBJECT type
This fix extends sanitizeGemini to remove properties/required from any
schema node where type is not 'object'.
Fixes issues similar to anomalyco#3140, anomalyco#80361 parent ca8c23d commit cb71141
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
775 | 781 | | |
776 | 782 | | |
777 | 783 | | |
| |||
0 commit comments