{"record":{"id":"c4b56aa7b398fd6f","repo":"BerriAI/litellm","slug":"tool-name-not-found","errorCode":null,"errorMessage":"Tool {name} not found","messagePattern":"Tool (.+?) not found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/mcp_server_manager.py","lineNumber":5129,"sourceCode":"                candidate.server_name,\n                candidate.name,\n            ):\n                if identifier and normalize_server_name(identifier) == (normalized_server_name):\n                    return True\n            return False\n\n        if mcp_server is None:\n            for candidate in self.get_registry().values():\n                if _candidate_matches_server_name(candidate):\n                    mcp_server = candidate\n                    resolved_by_server_name_only = True\n                    break\n        if mcp_server is None:\n            fallback: Final = self._get_mcp_server_from_tool_name(name)\n            if fallback is not None and (not server_name or _candidate_matches_server_name(fallback)):\n                mcp_server = fallback\n        if mcp_server is None:\n            raise ValueError(f\"Tool {name} not found\")\n\n        if resolved_by_server_name_only:\n            tool_known: Final = (\n                name in self.tool_name_to_mcp_server_name_mapping\n                or prefixed_tool_name in self.tool_name_to_mcp_server_name_mapping\n            )\n            if not tool_known:\n                raise ValueError(f\"Tool {name} not found\")\n\n        return mcp_server\n\n    async def has_user_oauth_token(self, server: MCPServer, user_api_key_auth: UserAPIKeyAuth | None) -> bool:\n        \"\"\"Whether the v2 resolver can produce a per-user token for this server right now.\n\n        This is the preemptive 401's existence check, routed through the same resolver that drives\n        the egress so every authorization_code resolution (egress and the discovery challenge) runs\n        through v2. Returns False for a server the resolver does not own (a None spec).\n        \"\"\"","sourceCodeStart":5111,"sourceCodeEnd":5147,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py#L5111-L5147","documentation":"Raised while resolving which MCP server should handle a tool call when the tool name matches no registered server (directly or via alias). The manager iterates the registry and per-server tool listings; if no candidate exposes the tool, resolution fails with this error, indicating the server is unregistered or the tool name is misspelled.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:5129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the tool name spelling; list available tools first."],"exampleFix":"List tools via the tools endpoint, then call an existing name.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}