ComposioHQ/composio · error · ValidationError

Invalid proxy execute parameters

Error message

Invalid proxy execute parameters

What it means

SessionContext.proxyExecute() validates its params against SessionProxyExecuteParamsSchema and throws ValidationError (with the Zod error as cause) before forwarding the (transformed) request to the tool router session proxy endpoint.

Source

Thrown at ts/packages/core/src/models/SessionContext.ts:118

    }

    const response = await withCancellation(
      () => this.client.toolRouter.session.execute(this.sessionId, executeParams, requestOptions),
      requestOptions?.signal
    );
    return ToolRouterSessionExecuteResponseSchema.parse(transformExecuteResponse(response));
  }

  /**
   * Proxy API calls through Composio's auth layer.
   * The backend resolves the connected account from the toolkit within the session.
   */
  async proxyExecute(
    params: SessionProxyExecuteParams
  ): Promise<ToolRouterSessionProxyExecuteResponse> {
    const validated = SessionProxyExecuteParamsSchema.safeParse(params);
    if (!validated.success) {
      throw new ValidationError('Invalid proxy execute parameters', { cause: validated.error });
    }

    const signal = this.signal;
    const requestOptions = signal ? { signal } : undefined;

    const clientParams = transformProxyParams(validated.data);
    const response = await withCancellation(
      () =>
        this.client.toolRouter.session.proxyExecute(this.sessionId, clientParams, requestOptions),
      requestOptions?.signal
    );

    return {
      status: response.status,
      data: response.data,
      headers: response.headers,
      ...(response.binary_data
        ? {

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Inspect error.cause.issues for failing fields
  2. Type params as SessionProxyExecuteParams to catch mistakes at compile time
  3. Normalize LLM-emitted arguments (strings vs objects) before calling proxyExecute

Example fix

// before
await ctx.proxyExecute({ tool: 123, arguments: 'none' });
// after
await ctx.proxyExecute({ tool: 'github_create_issue', arguments: { title: 'x' } });
Defensive patterns

Strategy: type-guard

Validate before calling

import { SessionProxyExecuteParamsSchema } from '@composio/core';
const r = SessionProxyExecuteParamsSchema.safeParse(params);
if (!r.success) throw new Error(JSON.stringify(r.error.issues));
await ctx.proxyExecute(params);

Type guard

const isProxyParams = (p: unknown): p is SessionProxyExecuteParams =>
  SessionProxyExecuteParamsSchema.safeParse(p).success;

Try / catch

try { await ctx.proxyExecute(params); } catch (e) { if (e instanceof ValidationError && /proxy execute/.test(e.message)) { params = normalizeLlmArgs(params); return ctx.proxyExecute(params); } throw e; }

Prevention

When it happens

Trigger: Calling session.context.proxyExecute(...) (or response/result helpers) with malformed params — wrong field names, missing required tool or args fields, or invalid types per SessionProxyExecuteParamsSchema.

Common situations: Forwarding raw JSON from an LLM tool call without normalizing; schema drift between SDK versions renaming proxy params; constructing params manually instead of from the SDK type.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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