fix(antigravity): strip deprecated/readOnly/writeOnly from tool schemas
Gemini/Antigravity generateContent rejects the JSON Schema annotation keywords deprecated, readOnly, writeOnly with a 400 INVALID_ARGUMENT. MCP tool schemas (e.g. Claude Code) commonly set deprecated:true, making every request with such a tool fail. Add them to UNSUPPORTED_SCHEMA_CONSTRAINTS so cleanJSONSchemaForAntigravity removes them recursively before the request is sent. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,8 @@ export const UNSUPPORTED_SCHEMA_CONSTRAINTS = [
|
||||
"default", "examples",
|
||||
// JSON Schema meta keywords
|
||||
"$schema", "$defs", "definitions", "const", "$ref", "$comment",
|
||||
// Annotation keywords (rejected by Gemini/Antigravity - e.g. MCP tool schemas set these)
|
||||
"deprecated", "readOnly", "writeOnly",
|
||||
// Object validation keywords (not supported)
|
||||
"additionalProperties", "propertyNames", "patternProperties", "enumDescriptions",
|
||||
// Complex schema keywords (handled by flattenAnyOfOneOf/mergeAllOf)
|
||||
|
||||
Reference in New Issue
Block a user