From df7579939317ea27db8b6d20c950c20b88897f20 Mon Sep 17 00:00:00 2001 From: Osraka <98612432+Osraka@users.noreply.github.com> Date: Tue, 16 Jun 2026 14:24:59 +0300 Subject: [PATCH] docs: sync MCP tool prefix examples --- docs/mcp_provider_interface.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/mcp_provider_interface.md b/docs/mcp_provider_interface.md index b98c9ac..ba63761 100644 --- a/docs/mcp_provider_interface.md +++ b/docs/mcp_provider_interface.md @@ -95,13 +95,15 @@ interface MCPContextValue { ### Prefixing Strategy Tools from each server are prefixed with the user-provided server name to avoid conflicts: +The implementation normalizes the server name and uses `__` as the separator so +prefixed tool names stay within provider tool-name constraints that disallow dots. ```typescript // Original tool from weather server: "get_weather" -// Prefixed tool: "weather_server.get_weather" +// Prefixed tool: "weather_server__get_weather" // Original tool from calendar server: "get_events" -// Prefixed tool: "calendar.get_events" +// Prefixed tool: "calendar__get_events" ``` ### Tool Discovery and Registration @@ -109,11 +111,12 @@ Tools from each server are prefixed with the user-provided server name to avoid class MCPConnection { private async discoverTools(): Promise { const tools = await this.client.listTools(); + const normalizedServerName = normalizeServerName(this.name); return tools.map(tool => ({ ...tool, function: { ...tool.function, - name: `${this.name}.${tool.function.name}`, // Add prefix + name: `${normalizedServerName}__${tool.function.name}`, // Add prefix description: `[${this.name}] ${tool.function.description}`, // Add server context } })); @@ -302,4 +305,4 @@ interface MCPMessage { 3. **Caching**: Tool schema and response caching 4. **Monitoring**: Connection health monitoring and alerts 5. **Batch Operations**: Bulk tool calling and resource access -6. **Custom Transports**: Support for WebSocket and custom transport protocols \ No newline at end of file +6. **Custom Transports**: Support for WebSocket and custom transport protocols