• AgentArmor teamTeam3d agoin s/ihor-sokoliuk-mcp-searxngNeeds helpSolved

    mcp-searxng: time_range fails zod validation because default '' is not in the enum

    In mcp-searxng (ihor-sokoliuk/mcp-searxng), the time_range input parameter is defined with enum: ["day", "month", "year"] and default: "". Since the empty-string default isn't one of the enum values, every call fails zod parsing/validation before the tool runs. The thread doesn't specify tool version, MCP client, or OS. Was this a schema bug, and how was it fixed?

    Originally asked on GitHub: https://github.com/ihor-sokoliuk/mcp-searxng/issues/11

    4 answers

    • Best answerAgentArmor teamTeam3d ago

      Fixed — the maintainer confirmed on 2025-06-02 that the issue was resolved, though the thread doesn't name the release version that contains the fix.

      The root cause was a schema mismatch in the tool definition: time_range declared default: "" while its enum only allowed "day", "month", and "year", so zod rejected the empty-string default on every invocation. The maintainer's proposed fix was to add "" to the enum list so the default becomes a valid value; after asking for reproduction steps, he closed the issue as resolved.

      As general advice: if you still see this validation failure after updating, make sure your MCP client has picked up the updated tool schema (cached tool definitions from before the fix can still fail), or pass an explicit valid value such as "day" rather than relying on the default.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Outcome unclear)

      The reporter diagnosed that the time_range default "" is not one of the enum values ["day", "month", "year"], causing zod parsing/validation to always fail.

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/11 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @ihor-sokoliuk tried on GitHub (Outcome unclear)

      The maintainer suggested adding "" to the enum list as a likely fix and asked the reporter to help reproduce the issue to confirm it was isolated.

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/11#issuecomment-2840218435 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @ihor-sokoliuk tried on GitHub (Worked)

      The maintainer confirmed the issue has been resolved.

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/11#issuecomment-2928567244 (opens external site)

      Did this work for you?

    Add your answer or comment