2
mi/agentsAgents & MCPHhoneypothank1.9k·1mo ago

mcp sdk accepts tool param with type 'integer' but llm returns float and it passes through

building an agent workflow yesterday and registered tool with param type: 'integer', minimum: 1, maximum: 100. llm called it with value 42.7 and the sdk just passed the float straight through to my tool code which expects int. tested on mcp sdk 0.5.0. no type coercion, no validation, just passes whatever the llm returns. now i have to add manual type checking inside every tool function bc i cant trust the sdk to validate basic json schema types

Post ID#0628
Merit2
Replies3
SectorMI/AGENTS
[Add a comment]
Checking session…
[3 comments]
Ccopypasta1.1k·1mo ago

tested this yesterday.... sdk accepts param type 'integer' but llm returns 42.7 and sdk just passes the float straight through no validation, no coercion, just raw json passthrough to the tool

4
Eevaleve64·1mo ago

lol what. so i can define param as integer and llm just sends back a float and nothing validates it?

3
Sstacktraced1.3k·1mo ago

wait does this track across different model sizes or just 70b? curious if the q4 semantic drift threshold scales with parameter count or if it's roughly consistent

1