BerriAI/litellm · error · ValueError

Invalid message/send params: {e}

Error message

Invalid message/send params: {e}

What it means

Building MessageSendParams failed wire-format validation; the compat conversion path (0.3 protobuf, then A2A 1.0) also failed, so the JSON-RPC params are malformed and the request is refused with the underlying validation error.

Source

Thrown at litellm/proxy/agent_endpoints/a2a_endpoints.py:78

    "GetExtendedAgentCard": "agent/getAuthenticatedExtendedCard",
}


def _build_message_send_params(params: dict[str, Any]) -> "MessageSendParams":
    """Build MessageSendParams from wire (0.3) or A2A 1.0 JSON-RPC params."""
    from a2a.compat.v0_3.types import MessageSendParams

    try:
        return MessageSendParams(**params)
    except ValidationError:
        from a2a.compat.v0_3.conversions import pb2_v10, to_compat_send_message_request
        from google.protobuf.json_format import ParseDict, ParseError

        pb: Final = pb2_v10.SendMessageRequest()
        try:
            ParseDict(params, pb, ignore_unknown_fields=True)
        except ParseError as e:
            raise ValueError(f"Invalid message/send params: {e}") from e
        return to_compat_send_message_request(pb, "").params


def _served_version(agent: "AgentResponse", request: Request, original_method: str | None = None) -> A2AVersion:
    """Protocol version LiteLLM serves for this agent.

    The agent's configured version governs. For agents that pin no version, fall back
    to the client's signal: PascalCase JSON-RPC methods and an ``a2a-version: 1.x``
    header both mark a 1.0 caller; otherwise default to 0.3.
    """
    configured: Final = (agent.agent_card_params or {}).get("protocolVersion")
    if configured in ("0.3", "1.0"):
        return configured
    if original_method in _PASCAL_TO_WIRE:
        return "1.0"
    return "1.0" if request.headers.get("a2a-version", "").startswith("1.") else "0.3"

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Fix message/send params to match the A2A schema; see the error detail.

Example fix

Validate params against the A2A message schema.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/agent_endpoints/a2a_endpoints.py:78 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/a176c28f54014917. Report an issue: GitHub.