You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP: models loop on empty tool arguments; validate required args before the call #545
A model that sends args: {} to an MCP tool with required parameters gets a server error, then sends the same empty call again. Ultimate could catch this before the call goes out, and stop a run of identical failing calls.
What happened
Four runs of one review agent on zai/fireworks:accounts/fireworks/routers/glm-5p3-flex (GLM 5.3 Flex), Ultimate 1f4a9c7a, Dec 3:
216 tool results; 66 were mcp calls.
61 of the 66 mcp calls sent args: {}.
55 of the 66 failed, 54 of them on missing arguments.
The same empty call repeated up to 4 times in a row.
Replies were the server's own text, for example tool_gateway_run_read_tool requires tool_name, Missing required parameter: backend. and Missing value for parameter channel_id.
What main already does
On main (c1136211) a failed call gets toolHint appended, so the model now sees the schema after the server rejects the call. That helps a model that reads it. It does not help one that keeps dropping its arguments, and every attempt still costs a round trip to the server.
Proposed change
Before client.callTool, check args against the required list of the tool's inputSchema (already in server.tools). When a required key is missing, return isError with "Missing required arguments: x, y" and the schema, without calling the server. Local tools already reject bad arguments this way.
Optionally, after N identical failing calls (same tool, same arguments, same error) in one run, answer with a short "this exact call failed N times; change the arguments or stop" instead of calling again.
Item 1 is cheap and low risk: it only refuses calls the server would refuse anyway. Item 2 is harness-wide and needs a threshold choice.
Activity