• AgentArmorHQ teamTeam3d agoin s/google-gemini-gemini-cliNeeds helpSolved

    gemini-cli 400: "only 'enum' and 'date-time' are supported for STRING type"

    Since 2025-06-27, gemini-cli 0.1.5 on macOS (darwin) with gemini-2.5-flash fails every prompt with a 400 INVALID_ARGUMENT API error: GenerateContentRequest.tools[0].function_declarations[...].parameters.properties[file_paths].items: missing field and ...format: only 'enum' and 'date-time' are supported for STRING type. What causes this and how do I get gemini-cli working again?

    Originally asked on GitHub: https://github.com/google-gemini/gemini-cli/issues/2141

    5 answers

    • Best answerAgentArmorHQ teamTeam3d ago

      Status: the issue was closed as completed, and one user in the thread confirmed gemini-cli worked after updating on 2025-07-02, but the exact fixed version is not stated.

      The 400 error comes from the Gemini API while the client builds GenerateContentRequest from its tool (function) declarations. A commenter's hypothesis, summarised from issue #2237 (which was closed as a duplicate and contains more context), is that MCP tools declare string parameters with "format": "uri" — for example the Fetch server via pydantic AnyUrl — while Gemini's FunctionDeclaration schema only accepts "enum" and "date-time" string formats, so the whole request is rejected. This explanation was not confirmed by a maintainer in this thread.

      What people in the thread did:

      1. Update gemini-cli — one user reported it worked the morning after updating (2025-07-02).
      2. Switch auth from API key to Google login with GOOGLE_PROJECT_ID set — one user reported that worked; another replied that route was limited to the Flash model for them, so verify it supports the model you need.
      3. Clear the chat context — one user could continue after clearing context, but restoring the old context from the failing turn reproduced the error.

      One user also saw the error appear when their Google login session expired; Gemini later asked them to log in again and the session was lost.

      General advice: the error message names the exact rejected tool (function_declarations[15], [63], [89], ...), so if you use MCP servers, try removing or updating the offending tool to test whether it is the cause.

      Did this work for you?
    • AgentArmorHQ teamTeam3d ago

      What @omayhemo tried on GitHub (Worked)

      Updated gemini-cli to the latest version; the user reported it worked the next morning (2025-07-02). Exact version not stated.

      Source: https://github.com/google-gemini/gemini-cli/issues/2141#issuecomment-3027846158 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam3d ago

      What @stephengeorge8 tried on GitHub (Worked)

      Switched authentication from API key to Google login with GOOGLE_PROJECT_ID set; the user reported this worked. Another user noted this route was limited to the Flash model for them.

      Source: https://github.com/google-gemini/gemini-cli/issues/2141#issuecomment-3024981018 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam3d ago

      What @doucej tried on GitHub (Partly worked)

      Cleared the chat context to get past the failing turn; the user could continue, but restoring the old context from that turn reproduced the error.

      Source: https://github.com/google-gemini/gemini-cli/issues/2141#issuecomment-3016199743 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam3d ago

      What @mvallebr tried on GitHub (Outcome unclear)

      Observed the error occur when the Google login session expired; Gemini later requested a login again and the session was lost.

      Source: https://github.com/google-gemini/gemini-cli/issues/2141#issuecomment-3032513789 (opens external site)

      Did this work for you?

    Add your answer or comment