ComposioHQ/composio · error · ValidationError

Invalid tool proxy parameters

Error message

Invalid tool proxy parameters

What it means

ValidationError('Invalid tool proxy parameters') is thrown by Tools.proxyExecute when body fails ToolProxyParamsSchema.safeParse, before headers/query are converted to Composio's { name, type, value } parameter format. The ZodError cause enumerates the failing fields.

Source

Thrown at ts/packages/core/src/models/Tools.ts:1343

   * // Send a custom request to a toolkit
   * const response = await composio.tools.proxyExecute({
   *   toolkitSlug: 'github',
   *   userId: 'default',
   *   data: {
   *     endpoint: '/repos/owner/repo/issues',
   *     method: 'GET'
   *   }
   * });
   * console.log(response.data);
   * ```
   */
  async proxyExecute(
    body: ToolProxyParams,
    requestOptions?: ComposioRequestOptions
  ): Promise<ToolProxyResponse> {
    const toolProxyParams = ToolProxyParamsSchema.safeParse(body);
    if (!toolProxyParams.success) {
      throw new ValidationError('Invalid tool proxy parameters', { cause: toolProxyParams.error });
    }
    // convert the headers and query to the composio format
    // { name: string, type: 'header' | 'query', value: string }
    const parameters: ComposioToolProxyParams.Parameter[] = [];
    const parameterTypes = {
      header: 'header',
      query: 'query',
    } as const;

    if (toolProxyParams.data.parameters) {
      parameters.push(
        ...(toolProxyParams.data.parameters ?? []).map(value => ({
          name: value.name,
          type: value.in === 'header' ? parameterTypes.header : parameterTypes.query,
          value: value.value.toString(),
        }))
      );
    }

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Check error.cause ZodError issues for the exact failing fields and fix them
  2. Supply all required fields (method, path) and shape headers/query per the current ToolProxyParamsSchema
  3. Pre-validate with the exported schema in tests to catch drift after SDK upgrades

Example fix

// before
await tools.proxyExecute({ method: 'GET' }); // missing path

// after
await tools.proxyExecute({ method: 'GET', path: '/v1/me', connectedAccountId });
Defensive patterns

Strategy: validation

Validate before calling

import { ToolProxyParamsSchema } from '@composio/core';
const ok = ToolProxyParamsSchema.safeParse(proxyBody);
if (!ok.success) {
  throw new Error(ok.error.issues.map(i => `${i.path}: ${i.message}`).join('; '));
}

Type guard

const hasMethodAndPath = (b: unknown): b is { method: string; path: string } =>
  typeof (b as any)?.method === 'string' && typeof (b as any)?.path === 'string';

Try / catch

try {
  await tools.proxyExecute(body);
} catch (e) {
  if (e instanceof ValidationError) console.error(e.cause?.issues);
}

Prevention

When it happens

Trigger: Calling tools.proxyExecute(body) with an invalid body — missing method or path, an unsupported HTTP method enum value, or headers/query/parameters not matching the shape the schema expects (it converts them to header/query typed parameter entries).

Common situations: Passing plain Records for headers/query where a specific structure is expected; omitting path; copying older proxy examples after a schema tightening; proxying to a URL built at runtime that ends up malformed.

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/4d5ac01e97b2ee3e. Report an issue: GitHub.