Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.
This repository was archived by the owner on May 15, 2026. It is now read-only.

[BUG] MCP tool names with hyphens fail when using native tool calling #10766

Closed

Description

@hori-so

Problem (one or two sentences)

MCP tools with hyphens in their names fail to execute when using native tool calling.
This regression occurs starting from Roo Code v3.40.0 (v3.39.3 works correctly).

Context (who is affected and when)

This affects users whose MCP servers use tools with hyphenated names.
In my case, a tool originally named mcp--abcdefghij-kl-mnop-qrs-tuv--wxyz-abcd-efghijk-lmno is transformed into mcp--abcdefghij___kl___mnop___qrs___tuv--wxyz___abcd___efghijk__, resulting in Roo Code being unable to resolve the tool.
(Note: The tool name has been masked for confidentiality.)

Reproduction steps

  1. Configure an MCP server that exposes a tool name containing hyphens (e.g., abcdefghij-kl-mnop-qrs-tuv--wxyz-abcd-efghijk-lmno).
  2. Use Roo Code v3.40.0 or later with native tool calling.
  3. Run a prompt that should invoke the MCP tool.
  4. Claude outputs a malformed tool name such as:
    mcp--abcdefghij___kl___mnop___qrs___tuv--wxyz___abcd___efghijk__
  5. Roo Code then reports that the tool does not exist.

Expected result

[Tool Use: mcp--abcdefghij-kl-mnop-qrs-tuv--wxyz-abcd-efghijk-lmno]

Actual result

[Tool Use: mcp--abcdefghij___kl___mnop___qrs___tuv--wxyz___abcd___efghijk__]

Variations tried (optional)

No response

App Version

v3.41.0 (regression occurs starting from v3.40.0; v3.39.3 works correctly)

API Provider (optional)

Amazon Bedrock

Model Used (optional)

anthropic.claude-sonnet-4-5-20250929-v1:0

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Date/time: 2026-01-16T01:21:05.506Z
Extension version: 3.41.0
Provider: bedrock
Model: anthropic.claude-sonnet-4-5-20250929-v1:0

ツール 'wxyz-abcd-efghijk__' はサーバー 'abcdefghij-kl-mnop-qrs-tuv' に存在しません。利用可能なツール: wxyz-abcd-efghijk-lmno

Activity

  1. mrubens commented on Jan 16, 2026

    @mrubens
    Collaborator

    @pdecat do you have any ideas on this one? Could it be related to #10644? Thank you!

  2. pdecat commented on Jan 16, 2026

    @pdecat
    Contributor

    Never faced that issue yet, but like roomote I guess this is essentially caused by the fact that the tool name is already long, and the encoding makes it a bit longer, and it happens to leaves two underscores at the end.

    I did not know there was a 64 characters limit for tool names, is that a hard limit?

  3. pdecat commented on Jan 16, 2026

    @pdecat
    Contributor

    According to https://modelcontextprotocol.io/specification/2025-11-25/server/tools#tool-names :

    Tool names SHOULD be between 1 and 128 characters in length (inclusive).

    Also:

    The following SHOULD be the only allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits (0-9), underscore (_), hyphen (-), and dot (.)

    So having to encode hyphens should not be required in the first place, but I guess not all models respect the spec...

  4. pdecat commented on Jan 16, 2026

    @pdecat
    Contributor

    @roomote Maybe we could hash the end of tool names instead of truncating them and thus loose information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions