Skip to content

Gemini models reject requests with exclusiveMinimum/exclusiveMaximum in tool schemas #86

@FammasMaz

Description

@FammasMaz

Description

Gemini models fail with 400 Bad Request when tool schemas contain JSON Schema validation keywords like exclusiveMinimum and exclusiveMaximum.

Error Message

{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"exclusiveMinimum\" at 'request.tools[0].function_declarations[8].parameters.properties[2].value': Cannot find field.",
    "status": "INVALID_ARGUMENT"
  }
}

Root Cause

In _clean_claude_schema() (src/rotator_library/providers/antigravity_provider.py), the validation_keywords_claude_only set contains these keywords, but the logic only strips them for Claude targets while preserving them for Gemini:

if key in validation_keywords_claude_only:
    if for_gemini:
        # Gemini accepts these - preserve them
        cleaned[key] = value
    # For Claude: skip - not supported
    continue

Gemini's Proto-based API does NOT support these keywords and rejects them with "Unknown name" errors.

Affected Keywords

All keywords in validation_keywords_claude_only are affected:

  • exclusiveMinimum, exclusiveMaximum
  • minimum, maximum
  • minLength, maxLength
  • minItems, maxItems
  • pattern, format
  • And others...

Suggested Fix

Strip these validation keywords for all targets (both Claude and Gemini), not just Claude.

Reference implementation: FammasMaz@3ad10fd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions