BerriAI/litellm · error · HTTPException

Invalid MCP tool prefix '{value}' provided via {field_name}

Error message

Invalid MCP tool prefix '{value}' provided via {field_name}

What it means

Error "Invalid MCP tool prefix '{value}' provided via {field_name}" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:234

        alias: Final = getattr(payload, "alias", None)

        if server_name:
            candidates.append(("server_name", server_name))
        if alias:
            candidates.append(("alias", alias))

        for field_name, value in candidates:
            if not value:
                continue

            validation_result = validate_tool_name(value)
            if validation_result.is_valid:
                continue

            error_messages_text = f"Invalid MCP tool prefix '{value}' provided via {field_name}"
            if validation_result.warnings:
                error_messages_text = error_messages_text + "\n" + "\n".join(validation_result.warnings)
            raise HTTPException(
                status_code=status.HTTP_400_BAD_REQUEST,
                detail={"error": error_messages_text},
            )

    def validate_and_normalize_mcp_server_payload(payload: McpServerPayloadLike) -> None:
        _base_validate_and_normalize_mcp_server_payload(payload)
        _validate_mcp_server_name_fields(payload)

    def stamp_omitted_oauth2_flow(payload: NewMCPServerRequest) -> None:
        """Fallback only: fill in oauth2_flow when an oauth2 create omits it.

        An explicit oauth2_flow from the caller (the dashboard's flow selector, a REST
        body, config.yaml) always wins and is never touched. The shape check below runs
        solely for oauth2 creates that leave the field unset, so those rows still
        persist a flow instead of relying on read-time inference.

        The create payload carries the plaintext credentials, so the M2M-vs-interactive
        decision is reliable here in a way it is not at read time (credentials are

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use a valid MCP tool prefix as documented for the field.
  2. Check the allowed prefix format in the proxy configuration documentation.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/mcp_management_endpoints.py:234 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/d737b12d444289a2. Report an issue: GitHub.