Fetch extension triggers 400 Bad request on Gemini models
Describe the bug
When using Gemini (Google AI studio) models with Fetch extension, the function definition sent by Goose triggers the following error on every chatbot response:
Ran into this error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[url].format: only 'enum' and 'date-time' are supported for STRING type
.
Please retry if you think this is a transient or recoverable error.
To Reproduce Steps to reproduce the behavior:
- Install Fetch extension via https://block.github.io/goose/extensions/
- Configure Google and select Gemini models (such as
Gemini-2.0-flash) in Goose app - Enable only Fetch extension in Goose app
- Say "hi" to Gemini in Goose app
Expected behavior
- Gemini can respond.
Screenshots
Error is reported instead
Please provide following information:
- OS & Arch: Mac OSX Ventura 13.7.1
- Interface: UI
- Version: v1.0.15
- Extensions enabled: Fetch
- Provider & Model:
gemini-2.0-flash,gemini-2.5-pro-exp-03-25provided by Google (not Vertex AI)
Additional context
- It is not reproducible in Anthropic and OpenAI models. Probably because Gemini API is more strict on function call types.
- I tried
mcp-server-fetch+ Gemini on Cline. LLM can respond correctly, and it can also invoke the MCP when I specifically ask it to access an URL using fetch MCP. - Checked https://github.com/modelcontextprotocol/servers/issues?q=is%3Aissue%20state%3Aopen%20fetch%20 , no similar issues there
I'm observing this as well:
goose --version
1.0.16
using a custom SSE based MCP server. Anthropic works fine.
Also observing this with mcp: https://github.com/sooperset/mcp-atlassian/ and gemini models - claude works perfectly fine.
command
( O)> jira_get_agile_boards project_key=SCRUM
goose --version 1.0.17
maybe caused by a gemini related bug https://github.com/block/goose/issues/945 ??
same here when using gemini
Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declarations[0].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[1].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[2].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[3].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[4].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[5].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[6].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[7].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[8].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.\n* GenerateContentRequest.tools[0].function_declarations[9].name: Invalid function name. Must start with a letter or an underscore.
Same here with Gemini 2.5 Pro.
I ran into this too - seems that if I turn off the 'fetch' extension gemini works for me.
Same error using the Sentry MCP: https://github.com/getsentry/sentry-mcp
Now with the most recent model gemini-2.5-flash
Hi, i've tested this with the new gemini-cli and could reproduce it there. Here's the issue thread: https://github.com/google-gemini/gemini-cli/issues/2237
The issue was recently moved from "need-triage" to "priority/p1", so i hope this gets some attention soon.
This happens to me with any extension enabled on the desktop client
Using 1.1.3
Error details
Error Type: Error
Message: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[url].format: only 'enum' and 'date-time' are supported for STRING type
Stack Trace:
Error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[url].format: only 'enum' and 'date-time' are supported for STRING type
at file:///Applications/Goose.app/Contents/Resources/app.asar/.vite/renderer/main_window/assets/App-CwluxdNf.js:511:968
at async file:///Applications/Goose.app/Contents/Resources/app.asar/.vite/renderer/main_window/assets/App-CwluxdNf.js:511:2509
at async file:///Applications/Goose.app/Contents/Resources/app.asar/.vite/renderer/main_window/assets/App-CwluxdNf.js:511:2967
Was fixed in #3328