From 3d20a4ccd27397001cc0a1c0bfd66d412c609e7b Mon Sep 17 00:00:00 2001 From: iletai Date: Mon, 29 Jun 2026 15:09:29 +0700 Subject: [PATCH] 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 --- open-sse/translator/formats/gemini.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/open-sse/translator/formats/gemini.js b/open-sse/translator/formats/gemini.js index 3fe4eb7b..8fdfac8d 100644 --- a/open-sse/translator/formats/gemini.js +++ b/open-sse/translator/formats/gemini.js @@ -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)