BerriAI/litellm · error · HTTPException

Request arguments are required

Error message

Request arguments are required

What it means

The session-based tool-call entry (call_tool) requires arguments to be a mapping; arguments=None is rejected immediately with HTTP 400 "Request arguments are required". The MCP protocol makes tools/call arguments optional, so minimal clients that omit the field hit this. An empty object is accepted — only None is refused. The REST endpoint (POST /mcp-rest/tools/call) defaults arguments to {} and never raises this.

Source

Thrown at litellm/proxy/_experimental/mcp_server/server.py:3103

        name: str,
        arguments: dict[str, object] | None = None,
        user_api_key_auth: UserAPIKeyAuth | None = None,
        mcp_auth_header: str | None = None,
        mcp_servers: list[str] | None = None,
        mcp_server_auth_headers: dict[str, dict[str, str]] | None = None,
        oauth2_headers: dict[str, str] | None = None,
        raw_headers: dict[str, str] | None = None,
        **kwargs: Any,
    ) -> CallToolResult:
        """
        Call a specific tool with the provided arguments (handles prefixed tool names).
        """
        start_time: Final = datetime.now()
        litellm_logging_obj: Final[LiteLLMLoggingObj | None] = kwargs.get("litellm_logging_obj", None)

        try:
            if arguments is None:
                raise HTTPException(status_code=400, detail="Request arguments are required")

            ## CHECK IF USER IS ALLOWED TO CALL THIS TOOL
            allowed_mcp_server_ids: Final = await global_mcp_server_manager.get_allowed_mcp_servers(
                user_api_key_auth=user_api_key_auth,
            )

            allowed_mcp_servers: list[MCPServer] = []
            for allowed_mcp_server_id in allowed_mcp_server_ids:
                allowed_server = global_mcp_server_manager.get_mcp_server_by_id(allowed_mcp_server_id)
                if allowed_server is not None:
                    # Same request-time oauth2_flow backstop the listing path applies,
                    # so a null-flow M2M-shape row is treated as M2M on tool calls too.
                    allowed_server = MCPServerManager.resolve_oauth2_flow_for_request(allowed_server)
                    allowed_mcp_servers.append(allowed_server)

            allowed_mcp_servers = await _get_allowed_mcp_servers_from_mcp_server_names(
                mcp_servers=mcp_servers,
                allowed_mcp_servers=allowed_mcp_servers,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Always include "arguments": {} (or the real payload) in every tools/call request.
  2. Update wrapper code that passes arguments=None to pass an empty dict instead.
  3. Prefer POST /mcp-rest/tools/call for no-arg tools — it defaults arguments to {} for you.

Example fix

# before
result = await session.call_tool("get_time", arguments=None)

# after
result = await session.call_tool("get_time", arguments={})
Defensive patterns

Strategy: validation

Validate before calling

def build_tool_call(name: str, arguments: dict | None) -> dict:
    return {"name": name, "arguments": arguments if arguments is not None else {}}

payload = build_tool_call("get_time", None)  # never omit arguments

Type guard

def is_arguments_mapping(obj: object) -> bool:
    """MCP arguments may be optional per spec, but LiteLLM requires a mapping."""
    return isinstance(obj, dict)

Try / catch

try:
    result = await session.call_tool(name, arguments=arguments)
except Exception as e:
    if "Request arguments are required" in str(e):
        return await session.call_tool(name, arguments={})  # retry once with empty mapping
    raise

Prevention

When it happens

Trigger: A tools/call JSON-RPC request without an "arguments" member; SDK calls like execute_mcp_tool(..., arguments=None); no-argument tools invoked with the field skipped entirely.

Common situations: Custom MCP clients following the protocol's optionality; agent frameworks passing None for parameterless tools; hand-rolled JSON-RPC senders.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/00f741956b9ae943. Report an issue: GitHub.