Describe the bug
When using codemode with MCP tools that have hyphenated names (e.g., list-calendars, create-event), the tool execution fails with "Tool not found" error. The toKebabCase function used to convert camelCase back to the original tool name produces incorrect output, losing underscores and casing.
To Reproduce
Steps to reproduce the behavior:
- Start the codemode example with npm start
- Add an MCP server with hyphenated tool names (e.g., Google Calendar MCP with list-calendars, list-events)
- Tools get discovered as tool_QuqMEGAF_list-calendars
- Send a message like "List my calendars"
- See error: Tool not found: tool-quq-megaflist-calendars
Expected behavior
The tool should be found and executed. The function name passed to callTool should match the original: tool_QuqMEGAF_list-calendars
Actual behavior
The Proxy's toKebabCase function converts toolQuqMegafListCalendars to tool-quq-megaflist-calendars which doesn't match the original tool name.
Version
- @cloudflare/codemode: 0.0.5
- agents: 0.3.6