BerriAI/litellm · error · ValueError

Tool {name} not found

Error message

Tool {name} not found

What it means

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.

Source

Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:5129

                candidate.server_name,
                candidate.name,
            ):
                if identifier and normalize_server_name(identifier) == (normalized_server_name):
                    return True
            return False

        if mcp_server is None:
            for candidate in self.get_registry().values():
                if _candidate_matches_server_name(candidate):
                    mcp_server = candidate
                    resolved_by_server_name_only = True
                    break
        if mcp_server is None:
            fallback: Final = self._get_mcp_server_from_tool_name(name)
            if fallback is not None and (not server_name or _candidate_matches_server_name(fallback)):
                mcp_server = fallback
        if mcp_server is None:
            raise ValueError(f"Tool {name} not found")

        if resolved_by_server_name_only:
            tool_known: Final = (
                name in self.tool_name_to_mcp_server_name_mapping
                or prefixed_tool_name in self.tool_name_to_mcp_server_name_mapping
            )
            if not tool_known:
                raise ValueError(f"Tool {name} not found")

        return mcp_server

    async def has_user_oauth_token(self, server: MCPServer, user_api_key_auth: UserAPIKeyAuth | None) -> bool:
        """Whether the v2 resolver can produce a per-user token for this server right now.

        This is the preemptive 401's existence check, routed through the same resolver that drives
        the egress so every authorization_code resolution (egress and the discovery challenge) runs
        through v2. Returns False for a server the resolver does not own (a None spec).
        """

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Check the tool name spelling; list available tools first.

Example fix

List tools via the tools endpoint, then call an existing name.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:5129 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/c4b56aa7b398fd6f. Report an issue: GitHub.