Skip to content

Support hyphenated tool names from MCP servers #591

@Softdev1

Description

@Softdev1

Description

MCP servers like Notion use hyphens in tool names (e.g. retrieve-a-page, create-a-page). BaseTool validates names against ^[a-zA-Z0-9_]+$, so hyphenated names fail validation and get silently dropped - the tool never registers and the agent has no access to it.

Fix:

  • Sanitize tool names in McpToolAdapter by replacing hyphens with underscores before passing to BaseTool.
  • Preserve the original hyphenated name in originalMcpName and use it for all actual MCP server calls (callTool).
  • The LLM sees the underscore version; the MCP server receives the original - no behavior change on either side.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions