{"record":{"id":"d41e85b30c028563","repo":"modelcontextprotocol/servers","slug":"unknown-tool-name","errorCode":null,"errorMessage":"Unknown tool: {name}","messagePattern":"Unknown tool: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/git/src/mcp_server_git/server.py","lineNumber":598,"sourceCode":"                return [TextContent(\n                    type=\"text\",\n                    text=result\n                )]\n\n            case GitTools.BRANCH:\n                result = git_branch(\n                    repo,\n                    arguments.get(\"branch_type\", 'local'),\n                    arguments.get(\"contains\", None),\n                    arguments.get(\"not_contains\", None),\n                )\n                return [TextContent(\n                    type=\"text\",\n                    text=result\n                )]\n\n            case _:\n                raise ValueError(f\"Unknown tool: {name}\")\n\n    options = server.create_initialization_options()\n    async with stdio_server() as (read_stream, write_stream):\n        await server.run(read_stream, write_stream, options, raise_exceptions=True)\n","sourceCodeStart":580,"sourceCodeEnd":603,"githubUrl":"https://github.com/modelcontextprotocol/servers/blob/76d64c822f5125032f89eb71dbdb94e42b434821/src/git/src/mcp_server_git/server.py#L580-L603","documentation":"The git server's call_tool dispatch (server.py:487-598) matches on the tool name; the case _ at line 597-598 raises ValueError('Unknown tool: {name}') for anything not in the GitTools enum. The server runs with raise_exceptions=True (line 602), so this propagates to the MCP client.","triggerScenarios":"Client invokes a tool name the running server version does not register: a typo, a name from a newer/older release, or a tool that belongs to a different server. For example calling 'git_log' or 'log' when the server advertises neither.","commonSituations":"Version skew between a hardcoded client config and the installed mcp-server-git. Client copied a tool name from outdated docs. Duplicate/misrouted dispatch across multiple MCP servers.","solutions":["Call list_tools at runtime and use only names it actually advertises.","Upgrade or downgrade client and server to matching versions.","Fix the typo in the tool name against the advertised list.","Confirm the request is routed to the git server, not a different MCP server."],"exampleFix":"// before\n//   session.call_tool(\"git_log\", ...)   -> Unknown tool\n// after\n//   name in {t.name for t in (await session.list_tools()).tools}  # use a real one","handlingStrategy":"validation","validationCode":"known = {t.name for t in (await session.list_tools()).tools}\nif name not in known:\n    raise ValueError(f\"{name!r} not offered by git server; choose from {sorted(known)}\")\nawait session.call_tool(name, arguments)","typeGuard":"async def is_known_tool(session, name: str) -> bool:\n    return name in {t.name for t in (await session.list_tools()).tools}","tryCatchPattern":"try:\n    await session.call_tool(name, arguments)\nexcept Exception as e:\n    if \"Unknown tool\" in str(e):\n        # refresh advertised tools and retry with a corrected name\n        ...\n    raise","preventionTips":["Drive tool names from list_tools at runtime rather than hardcoding them.","Pin client and mcp-server-git to compatible versions.","Confirm routing when multiple MCP servers are connected."],"tags":["git","dispatch","version-skew","python"],"backgroundTag":null,"analyzedSha":"76d64c822f5125032f89eb71dbdb94e42b434821","analyzedAt":"2026-08-12T10:02:41.718Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}