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
I have a server with a tool that takes an int argument. But many LLMs actually provide me with a string instead, like "5". Then I get errors like fastmcp.exceptions.ToolError: Input validation error: '5' is not of type 'integer'.
As LLMs make minor type mistakes like that with some regularity, some automatic type coercion would be very helpful. Is there some easy way to handle such errors, and try to coerce the type before throwing exceptions?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a server with a tool that takes an
int
argument. But many LLMs actually provide me with a string instead, like"5"
. Then I get errors likefastmcp.exceptions.ToolError: Input validation error: '5' is not of type 'integer'
.As LLMs make minor type mistakes like that with some regularity, some automatic type coercion would be very helpful. Is there some easy way to handle such errors, and try to coerce the type before throwing exceptions?
Beta Was this translation helpful? Give feedback.
All reactions