{"record":{"id":"a487653e70b8ad6f","repo":"BerriAI/litellm","slug":"invalid-display-name-display-name-for-tool-o","errorCode":null,"errorMessage":"Invalid display name '{display_name}' for tool '{original_name}'. Display names may only contain letters, digits, underscores, and hyphens (no spaces or other special characters), since they replace the tool name sent to the LLM provider.","messagePattern":"Invalid display name '(.+?)' for tool '(.+?)'\\. Display names may only contain letters, digits, underscores, and hyphens \\(no spaces or other special characters\\), since they replace the tool name sent to the LLM provider\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/utils.py","lineNumber":599,"sourceCode":"    Validate tool display name overrides against Bedrock's tool-name constraint.\n\n    A display name replaces the tool name sent to the LLM provider, so it must\n    satisfy the strictest provider requirement in use (Bedrock's\n    ``[a-zA-Z0-9_-]+``); a name with spaces or other characters saves\n    successfully but fails every subsequent Bedrock tool call.\n\n    Raises:\n        HTTPException: If any display name fails the pattern.\n    \"\"\"\n    if not tool_name_to_display_name:\n        return\n\n    for original_name, display_name in tool_name_to_display_name.items():\n        if display_name and not TOOL_DISPLAY_NAME_PATTERN.match(display_name):\n            from fastapi import HTTPException\n            from starlette import status\n\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail={\n                    \"error\": (\n                        f\"Invalid display name '{display_name}' for tool '{original_name}'. \"\n                        \"Display names may only contain letters, digits, underscores, and \"\n                        \"hyphens (no spaces or other special characters), since they replace \"\n                        \"the tool name sent to the LLM provider.\"\n                    )\n                },\n            )\n\n\nclass MCPMissingUserEnvVarsError(Exception):\n    \"\"\"Raised when an MCP request can't be built because the calling user has\n    not supplied one or more required per-user environment variables.\n\n    The error message is user-facing and includes a URL the user can visit\n    to fill them in.","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/utils.py#L581-L617","documentation":"Error \"Invalid display name '{display_name}' for tool '{original_name}'. Display names may only contain letters, digits, underscores, and hyphens (no spaces or other special characters), since they replace the tool name sent to the LLM provider.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/utils.py:599 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only letters, digits, underscores, and hyphens in the tool display name."],"exampleFix":"display_name='my-tool_v2'","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-14T11:17:12.474Z"}