Skip to main content

Module mcp_tool_names

Module mcp_tool_names 

Source
Expand description

MCP tool-name parsing and building.

Pure string functions over tool name spellings, with no dependency on the tool system. This is the single home for MCP name shapes so the agent runtime, policy gates, and transcript display never fork the parsing.

§MCP Tool Name Format

Canonical form is mcp::<provider>::<tool_name>. Model-visible form is mcp__<provider>__<tool>. Legacy form is mcp_<provider>_<tool_name>.

Constants§

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

Functions§

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>.