Skip to content

fix(gemini): strip propertyNames from tool schemas#3426

Open
pascalwhoop wants to merge 2 commits into
tailcallhq:mainfrom
pascalwhoop:fix/gemini-strip-property-names
Open

fix(gemini): strip propertyNames from tool schemas#3426
pascalwhoop wants to merge 2 commits into
tailcallhq:mainfrom
pascalwhoop:fix/gemini-strip-property-names

Conversation

@pascalwhoop
Copy link
Copy Markdown

@pascalwhoop pascalwhoop commented May 31, 2026

Summary

Strip propertyNames from Gemini tool schemas to avoid Google API 400 errors for unsupported function declaration fields.

Context

Gemini function declarations use an OpenAPI-style schema subset and reject some JSON Schema keywords. Tool schemas that include propertyNames can currently fail with errors like:

I found this when trying to get 3.5-flash going

Invalid JSON payload received. Unknown name "propertyNames" at 'tools[0].function_declarations...'

additionalProperties and other unsupported keywords are already removed by the Gemini schema sanitizer; this adds the missing propertyNames case.

Changes

  • Add propertyNames to the unsupported keyword list removed from Gemini schemas
  • Update the sanitizer comment to document the removal
  • Add a regression test that verifies nested propertyNames entries are absent from the serialized sanitized schema

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 31, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants