Skip to content

Conversation

@xuwenyihust
Copy link
Contributor

@xuwenyihust xuwenyihust commented Dec 20, 2025

Motivation

Currently when multiple MCP servers registered, the tool name collisions will cause an overwrite in inventory (Insert into Dashmap with duplicated keys).

For example both postgres and DuckDB has tool query.

Modifications

  • Storing tools & prompts with naming server_name.tool/prompt_name in inventory to avoid collision
  • The McpManager public API (call_tool, get_prompt) now operates on these qualified names for lookup and routing
  • Actual request to MCP servers will strip the prefix and contain only the original name
  • Associated unit tests updated.

Accuracy Tests

Both Tools in Response

"tools": [
                {
                    "name": "postgres.query",
                    "description": "Run a read-only SQL query",
                    "input_schema": {
                        "type": "object",
                        "properties": {
                            "sql": {
                                "type": "string"
                            }
                        }
                    },
                    "annotations": {
                        "read_only": false
                    }
                },
                {
                    "name": "duckdb.query",
                    "description": "Execute a query on the DuckDB database",
                    "input_schema": {
                        "type": "object",
                        "properties": {
                            "query": {
                                "type": "string",
                                "description": "SQL query to execute"
                            }
                        },
                        "required": [
                            "query"
                        ]
                    },
                    "annotations": {
                        "read_only": false
                    }
                }
            ]

Originally Only 1 Stored into Inventory with Collision

Screenshot 2025-12-20 at 2 57 40 PM

Now Both Stored with Prefix

Screenshot 2025-12-20 at 2 58 22 PM

Correct Tool Calling

Screenshot 2025-12-20 at 3 00 38 PM

Checklist

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants