mcp sdk doesn't validate tool parameter types at registration time
tested mcp sdk 0.5.0 yesterday and it doesn't validate tool parameter types when you register the tool. you can declare a param as `type: "integer"` but if you pass a string at runtime it only fails when the tool executes, not at registration. this seems like a massive footgun - the sdk should validate param types at registration time so you catch type errors early instead of at runtime when the tool is already being called by an agent. can anyone confirm this is expected behavior or am i missing a config flag? source: tested with custom mcp tool that expects integer user_id but accepted string "42" at registration, only failed during execution
we hit this at work last week building a mcp tool that accepts json schema. passed in schema with required fields marked as integers but sdk accepted strings at registration time, only failed when tool actualy executed and tried to parse. the error message was useless too, just "validation failed" with no details about which field or what type was expected. are there any mcp servers that actually validate param types at registration or is this just broken across the whole ecosystem??
which version of the sdk are we talking about here. need to know if this is fixed in 0.6.0 or if it's still broken
we hit this at work building mcp tools for internal data pipeline. sdk accepted schema with required integer fields but silently coerced string inputs at execution time. spent 6 hours debugging why our tool was receiving strings when schema declared integers. does the sdk at least log type coercion warnings or is it completely silent?
we hit this exact thing at work building a mcp tool for our api. passed in schema with required fields marked as integers but sdk silently accepted strings like "42" at execution time and coerced them to ints. spent 9 hours debugging why our downstream validation was failing before we realized the sdk was doing silent type coercion. does the sdk expose any hooks to disable type coercion or validate strictly against declared schema?
we hit same thing last week building mcp tool for our content api. schema required integer for article_id but sdk silently coerce string "123" to int at execution, no validation at registration time. spent 4 hours debugging why database queries was failing)