ComposioHQ/composio · error · ValidationError

proxy_execute: toolkit is required

Error message

proxy_execute: toolkit is required

What it means

Client-side guard in proxy_execute that rejects the call before any network traffic when the toolkit argument is falsy. It mirrors the TS SessionProxyExecuteParamsSchema so both SDKs fail identically on missing required params.

Source

Thrown at python/composio/core/models/session_context.py:54

def proxy_execute_impl(
    client: HttpClient,
    session_id: str,
    *,
    toolkit: str,
    endpoint: str,
    method: t.Literal["GET", "POST", "PUT", "DELETE", "PATCH"],
    body: t.Any = None,
    parameters: t.Optional[t.List[t.Dict[str, t.Any]]] = None,
) -> ToolRouterSessionProxyExecuteResponse:
    """Shared proxy execute implementation used by SessionContextImpl and ToolRouterSession.

    Projects the generated client's response model onto the SDK's own shape so
    the public return type does not move when the client is regenerated.
    """
    # Client-side validation (matches TS SessionProxyExecuteParamsSchema)
    if not toolkit:
        raise ValidationError("proxy_execute: toolkit is required")
    if not endpoint:
        raise ValidationError("proxy_execute: endpoint is required")
    if method not in _VALID_METHODS:
        raise ValidationError(
            f"proxy_execute: method must be one of {sorted(_VALID_METHODS)}, got {method!r}"
        )

    # Transform and validate parameters
    api_params: t.List[Parameter] = []
    if parameters:
        for i, p in enumerate(parameters):
            if not isinstance(p, dict) or "name" not in p or "value" not in p:
                raise ValidationError(
                    f"proxy_execute: parameters[{i}] must be a dict with 'name' and 'value' keys"
                )
            param_type = p.get("in", p.get("type", "header"))
            if param_type not in _VALID_PARAM_TYPES:
                raise ValidationError(

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Pass a non-empty toolkit slug, e.g. 'github'
  2. Log/validate dynamic param dicts before calling proxy_execute

Example fix

# before
session.proxy_execute(toolkit=tk, endpoint="/repos")  # tk is None

# after
tk = tk or "github"
session.proxy_execute(toolkit=tk, endpoint="/repos")
Defensive patterns

Strategy: validation

Validate before calling

if not toolkit:
    raise ValueError('toolkit is required')

Type guard

def has_toolkit(p: dict) -> bool:
    return bool(p.get('toolkit'))

Prevention

When it happens

Trigger: Calling session.proxy_execute(toolkit=None/'', endpoint=...) or omitting the toolkit positional/keyword — e.g. building params dynamically and passing an empty string.

Common situations: Programmatically constructed proxy calls where a variable holding the toolkit slug is None because a preceding lookup failed.

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 ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/e0c2f8262f223a30. Report an issue: GitHub.