{"record":{"id":"d737b12d444289a2","repo":"BerriAI/litellm","slug":"invalid-mcp-tool-prefix-value-provided-via-fi","errorCode":null,"errorMessage":"Invalid MCP tool prefix '{value}' provided via {field_name}","messagePattern":"Invalid MCP tool prefix '(.+?)' provided via (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/mcp_management_endpoints.py","lineNumber":234,"sourceCode":"        alias: Final = getattr(payload, \"alias\", None)\n\n        if server_name:\n            candidates.append((\"server_name\", server_name))\n        if alias:\n            candidates.append((\"alias\", alias))\n\n        for field_name, value in candidates:\n            if not value:\n                continue\n\n            validation_result = validate_tool_name(value)\n            if validation_result.is_valid:\n                continue\n\n            error_messages_text = f\"Invalid MCP tool prefix '{value}' provided via {field_name}\"\n            if validation_result.warnings:\n                error_messages_text = error_messages_text + \"\\n\" + \"\\n\".join(validation_result.warnings)\n            raise HTTPException(\n                status_code=status.HTTP_400_BAD_REQUEST,\n                detail={\"error\": error_messages_text},\n            )\n\n    def validate_and_normalize_mcp_server_payload(payload: McpServerPayloadLike) -> None:\n        _base_validate_and_normalize_mcp_server_payload(payload)\n        _validate_mcp_server_name_fields(payload)\n\n    def stamp_omitted_oauth2_flow(payload: NewMCPServerRequest) -> None:\n        \"\"\"Fallback only: fill in oauth2_flow when an oauth2 create omits it.\n\n        An explicit oauth2_flow from the caller (the dashboard's flow selector, a REST\n        body, config.yaml) always wins and is never touched. The shape check below runs\n        solely for oauth2 creates that leave the field unset, so those rows still\n        persist a flow instead of relying on read-time inference.\n\n        The create payload carries the plaintext credentials, so the M2M-vs-interactive\n        decision is reliable here in a way it is not at read time (credentials are","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/mcp_management_endpoints.py#L216-L252","documentation":"Error \"Invalid MCP tool prefix '{value}' provided via {field_name}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid MCP tool prefix as documented for the field.","Check the allowed prefix format in the proxy configuration documentation."],"exampleFix":null,"handlingStrategy":null,"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"}