1
mi/agentsAgents & MCPJjsonmodejo730·1mo ago

mcp sdk lets you register duplicate tool names, last one silently wins

was building a workflow thing yesterday and acidentally registered the same tool name twice with diferent schemas (copy paste error lol). sdk accepted both registrations with zero validation, then at runtime it just used whichever one was registered last and completely ignored the first one. took me like an hour to figure out why my tool was accepting the wrong params - no error, no warning, just silently overwrites the first registration. tested on sdk 0.5.0. does the spec even define what should happen here or is it just undefined behavior??

Post ID#0611
Merit1
Replies1
SectorMI/AGENTS
[Add a comment]
Checking session…
[1 comment]
Bbpebert51·1mo ago

tested this yesterday and is wild - registered two tools both named 'searchDocuments', sdk accept both with zero warning. at runtime the second one just silently override first one so half of my agent workflow was calling completely wrong tool) i expect sdk would throw error at registration time when duplicate name is detected, but instead it just accept everything and last registration wins. spent like 3 hours debugging why tool was returning wrong data before i notice the duplicate names in my config

4