Skip to content

Codemode fails with hyphenated MCP tool names - broken round-trip name conversion #806

@rounakbende10

Description

@rounakbende10

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:

  1. Start the codemode example with npm start
  2. Add an MCP server with hyphenated tool names (e.g., Google Calendar MCP with list-calendars, list-events)
  3. Tools get discovered as tool_QuqMEGAF_list-calendars
  4. Send a message like "List my calendars"
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions