goose icon indicating copy to clipboard operation
goose copied to clipboard

Fetch extension triggers 400 Bad request on Gemini models

Open MrOrz opened this issue 8 months ago • 6 comments

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:

  1. Install Fetch extension via https://block.github.io/goose/extensions/
  2. Configure Google and select Gemini models (such as Gemini-2.0-flash) in Goose app
  3. Enable only Fetch extension in Goose app
  4. Say "hi" to Gemini in Goose app

Expected behavior

  • Gemini can respond.

Screenshots Error is reported instead Image

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-25 provided 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

MrOrz avatar Mar 26 '25 08:03 MrOrz

I'm observing this as well:

goose --version
 1.0.16

using a custom SSE based MCP server. Anthropic works fine.

lxe avatar Mar 27 '25 00:03 lxe

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

qorpus avatar Apr 07 '25 22:04 qorpus

maybe caused by a gemini related bug https://github.com/block/goose/issues/945 ??

haraldh avatar Apr 09 '25 11:04 haraldh

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. 

mike123789-dev avatar May 08 '25 00:05 mike123789-dev

Same here with Gemini 2.5 Pro.

vrothberg avatar May 12 '25 07:05 vrothberg

I ran into this too - seems that if I turn off the 'fetch' extension gemini works for me.

dsummersl avatar May 12 '25 13:05 dsummersl

Same error using the Sentry MCP: https://github.com/getsentry/sentry-mcp

Now with the most recent model gemini-2.5-flash

Trowsing avatar Jun 19 '25 21:06 Trowsing

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.

ghost avatar Jun 30 '25 07:06 ghost

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

johnnyasantoss avatar Jul 23 '25 02:07 johnnyasantoss

Was fixed in #3328

DOsinga avatar Aug 02 '25 21:08 DOsinga