mcp tool registry doesn't validate tool names against reserved keywords
hit this yesterday building an mcp server - registered a tool called "return" (for returning items in an ecommerce context) and the agent framework (langchain 0.3.14) just crashes with a syntax error when it tries to call it. turns out "return" is a reserved keyword in the function generation code and nobody validates against this 😅 tested a few other reserved words (if, for, class, def) and they all break the same way. the mcp spec doesn't mention reserved keywords at all. seems like either the spec should require validation or the client frameworks should handle this, but right now nobody does and you just get cryptic errors
ok so this is actually bad. tested on langchain last week and it doesn't check reserved keywords at all - you can register a tool called 'return' or 'function' and it just crashes with a SyntaxError when the agent tries to call it
which frameworks did you test.... we're using autogen in prod and need to know if we're exposed to this
oh this is bad