{"record":{"id":"70f2a61e602a7532","repo":"BerriAI/litellm","slug":"unreachable","errorCode":"unreachable","errorMessage":"Listing tools from MCP server {server_name!r} failed","messagePattern":"Listing tools from MCP server (.+?) failed","errorType":"exception","errorClass":"MCPServerListError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/mcp_server_manager.py","lineNumber":4276,"sourceCode":"            server_name: Name of the server for logging\n\n        Returns:\n            List of tools from the server\n        \"\"\"\n        try:\n            with anyio.fail_after(MCP_TOOL_LISTING_TIMEOUT):\n                tools: Final = await client.list_tools(raise_on_error=True)\n                verbose_logger.debug(\"Tools from %s: %s\", server_name, tools)\n                return tools\n        except TimeoutError as e:\n            verbose_logger.warning(\"Timeout while listing tools from %s\", server_name)\n            raise MCPServerListError(ServerListFault(tag=\"timeout\"), server_name) from e\n        except asyncio.CancelledError as e:\n            verbose_logger.warning(\"Task cancelled while listing tools from %s\", server_name)\n            raise MCPServerListError(ServerListFault(tag=\"internal\"), server_name) from e\n        except ConnectionError as e:\n            verbose_logger.warning(\"Connection error while listing tools from %s: %s\", server_name, e)\n            raise MCPServerListError(ServerListFault(tag=\"unreachable\"), server_name) from e\n        except Exception as e:\n            verbose_logger.warning(\"Error listing tools from %s: %s\", server_name, e)\n            raise_classified_list_failure(e, server_name)\n\n    _SHORT_PREFIX_MAX_REHASH_ATTEMPTS = 1024\n\n    def _assign_unique_short_prefix(\n        self,\n        server: MCPServer,\n        registry: dict[str, MCPServer] | None = None,\n    ) -> None:\n        \"\"\"Resolve and cache a collision-free short tool prefix on ``server``.\n\n        Called at registration time for every MCP server entering the\n        registry.  Mutates ``server.short_prefix`` in place.  No-ops when\n        ``LITELLM_USE_SHORT_MCP_TOOL_PREFIX`` is disabled, when the server\n        has no ``server_id`` (synthetic temp-server objects), or when a\n        prefix is already cached.","sourceCodeStart":4258,"sourceCodeEnd":4294,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py#L4258-L4294","documentation":"Logged and re-raised wrapped in MCPServerListError when client.list_tools() on an MCP server raises anything other than a timeout (timeouts get their own 'timeout' ServerListFault). This is a generic catch-all for transport/protocol failures — connection reset, malformed JSON-RPC response, server closing the stream — while listing a registered MCP server's tools; the original exception is preserved as __cause__.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:4276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check upstream server reachability and credentials; see logs for the root cause."],"exampleFix":"Run the admin connection test for that server.","handlingStrategy":"try-catch","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-14T00:17:10.932Z"}