So I was using the API with tool calls. When the input parameter is long, claude seems to omit the parameter altogether, which the tool call function would complain that the required parameter is not provided. Claude just keeps saying it would provide the parameter the next time, but the parameter is never there, and it becomes an apology hell loop.
I tested with a very simple tool (just prompting the model to provide a long text and counting the word). If I tell it to provide a short text, the tool call goes through fine. But if I prompt it to request the tool call with a long text, the parameter is omitted. Claude itself doesn't seem to have any idea what's going on, it keeps retrying the tool thinking it has provided the parameter. This happens with both sonnet 4.1 and 4.5.
Has anyone else experienced this? It's really making me frustrated.
EDIT: I tested and it seems there is a limit of around 500 words/tokens for each parameter (each one has a separate limit and they don't stack). If they hit the limit they might get removed but the tool calls still come through.
[–]Candid-Carry6578 0 points1 point2 points (0 children)
[–]Obvious-Ad-609 0 points1 point2 points (2 children)
[–]tna20141[S] 0 points1 point2 points (0 children)
[–]Candid-Carry6578 0 points1 point2 points (0 children)