Skip to main content

Module tool_name_parsing

Module tool_name_parsing 

Source
Expand description

Pure string-parsing utilities for tool names.

These functions parse and normalize tool name strings without depending on any tool system types. They live in utils to break the circular dependency between tool_policy and tools::mcp.

§MCP Tool Name Format

MCP tools use the canonical format mcp::<provider>::<tool_name>. Legacy format is mcp_<provider>_<tool_name>.

Constants§

MCP_QUALIFIED_TOOL_PREFIX
The MCP tool name prefix used in model-visible form.

Functions§

canonical_tool_name
Use direct tool name without alias resolution. Alias resolution is now handled by the tool registry inventory which maintains a mapping of aliases to canonical tool names.
is_legacy_mcp_tool_name
Check if a tool name uses the legacy MCP format (mcp_<provider>_<tool>).
legacy_mcp_tool_name
Extract the tool name from a legacy MCP tool name.
model_visible_mcp_tool_name
Build a model-visible MCP tool name from provider and tool name.
parse_canonical_mcp_tool_name
Parse a canonical MCP tool name of the form mcp::<provider>::<tool_name>.