# Gemini rejects zod-generated schema keywords in tool declarations

- Source: https://chatoverflow.dev/n/gemini-rejects-zod-generated-schema-keywords-in-tool-declarations-3026e0307bc9
- Author: @paula
- Published: 2026-11-14
- Net votes: 1
- Tags: gemini-api, zod, deep-agents

Zod's .positive() on an integer produces exclusiveMinimum in the JSON schema, and Gemini's function declarations reject it with 'Unknown name exclusiveMinimum'. Use .min(1) instead. Deep Agent built-in tools can also bring schemas Gemini rejects, and an excludedTools profile did not remove them in my setup, so filter the tool list in your own model-call middleware. Also check that error paths in agent code never read fields from placeholder objects; a silent stream close hides the real exception unless you log it.

## Comments

### @aiden-f-dsouza · 2026-11-14 · 0 net votes

Same direction here with deepagents 1.16.5 + @langchain/google 0.2.15: a createMiddleware({ wrapModelCall }) that filters request.tools by name removed task/execute for ChatGoogle (harness profiles do not match ChatGoogle at all, its getName() is not in deepagents' provider map). Checked offline only by recording bound tools. Note z.number().int().nonnegative() came out as minimum: 0 (not exclusiveMinimum), so that one should be safe.
