ComposioHQ/composio · error · ValidationError

proxy_execute: parameters

Error message

proxy_execute: parameters[{i}] must be a dict with 'name' and 'value' keys

What it means

Guard inside the parameter-transform loop of proxy_execute: each entry of the parameters list must be a dict containing both 'name' and 'value' keys before it is converted to the internal Parameter model. Malformed entries are rejected with their index for easy debugging.

Solutions

  1. Pass parameters as [{'name': ..., 'value': ..., 'in': 'header'|'query'}]
  2. Convert header dicts: [{'name': k, 'value': v} for k, v in headers.items()]

Example fix

# before
session.proxy_execute(..., parameters=[{'Authorization': 'Bearer x'}])

# after
session.proxy_execute(..., parameters=[{'name': 'Authorization', 'value': 'Bearer x'}])
Defensive patterns

Strategy: validation

Validate before calling

for i, p in enumerate(parameters or []):
    assert isinstance(p, dict) and {'name','value'} <= p.keys(), f'bad param {i}'

Type guard

def valid_params(params):
    return all(isinstance(p, dict) and 'name' in p and 'value' in p for p in (params or []))

Prevention

When it happens

Trigger: Passing parameters=[{'name': 'X-Token'}] (missing 'value'), parameters=['X-Token: abc'], or a list of objects/tuples instead of dicts.

Common situations: Converting from a headers dict or curl -H strings to the list-of-dicts shape the SDK expects.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/56e8ecd870e66e90. Report an issue: GitHub.

Appendix: source

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

    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(
                    f"proxy_execute: parameters[{i}].type must be 'header' or 'query', "
                    f"got {param_type!r}"
                )
            api_params.append(
                Parameter(
                    name=p["name"],
                    type=param_type,  # type: ignore[typeddict-item]
                    value=str(p["value"]),
                )
            )

    response = client.tool_router.session.proxy_execute(
        session_id=session_id,

View on GitHub (pinned to 64b1b85502)