Skip to content

Conversation

@vchomakov
Copy link
Contributor

Problem

The JsonValue class was added to address Gemini tool exclusion issues, but it inadvertently caused the nested anyOf schema problem described in jlowin/fastmcp#1871. This nested anyOf structure breaks LLM clients' ability to properly parse and use the tool.

Solution

  • Remove the JsonValue class
  • Use simple str type for the value parameter instead
  • Add JSON parsing logic with graceful fallback:
    • Tries to parse input as JSON with json.loads()
    • Falls back to treating it as a plain string if parsing fails
    • Passes the result to Redis

Result

Generates a clean {"type": "string"} schema instead of nested anyOf. Verified with the latest Gemini version that tool exclusion no longer occurs.

@vchomakov vchomakov requested a review from mortensi October 31, 2025 17:15
@mortensi mortensi requested a review from bobymicroby November 3, 2025 07:08
Copy link
Member

@bobymicroby bobymicroby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vchomakov vchomakov merged commit 2390cce into main Nov 3, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants