Skip to content

Gemini provider: tool schema emits unsupported 'additionalProperties' field (12 tools rejected, all exec calls fail) #373

Description

@FerasMahmoud

Bug Description

Running any zero exec command against the Google/Gemini provider fails because Zero emits OpenAI-style JSON Schema tool declarations that Google's function_declarations API rejects.

Reproduction

  1. Install Zero 0.1.0 (npm install -g)
  2. zero providers setup google (configure API key)
  3. zero providers use google
  4. zero exec "say hi" --model gemini-2.5-pro

Error (exact)

All 12 tool declarations are rejected with:

Invalid JSON payload received. Unknown name "additionalProperties" at "tools[0].function_declarations[N].parameters": Cannot find field

This repeats for every tool in the payload. The exec call never reaches the model.

Root Cause

Zero serializes tool schemas using OpenAI's JSON Schema format, which includes fields like additionalProperties. Google's Generative AI API (GoogleGenAI v1alpha OpenAPI spec) uses function_declarations[].parameters and only supports a subset of JSON Schema — additionalProperties is not a recognized field and causes a 400 rejection.

Environment

  • Zero 0.1.0 (npm install)
  • WSL2 Ubuntu 24.04
  • Model: gemini-2.5-pro
  • Provider: Google (via zero providers setup google)

Suggested Fix

Strip OpenAI-only JSON Schema fields (additionalProperties, $schema, $id, patternProperties, etc.) from tool parameter schemas when transport=google before sending to the Gemini API. Alternatively, map to Google's parameters_schema using only the supported subset (type, description, properties, required, items, enum, nullable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions