{"record":{"id":"4d5ac01e97b2ee3e","repo":"ComposioHQ/composio","slug":"invalid-tool-proxy-parameters","errorCode":null,"errorMessage":"Invalid tool proxy parameters","messagePattern":"Invalid tool proxy parameters","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/Tools.ts","lineNumber":1343,"sourceCode":"   * // Send a custom request to a toolkit\n   * const response = await composio.tools.proxyExecute({\n   *   toolkitSlug: 'github',\n   *   userId: 'default',\n   *   data: {\n   *     endpoint: '/repos/owner/repo/issues',\n   *     method: 'GET'\n   *   }\n   * });\n   * console.log(response.data);\n   * ```\n   */\n  async proxyExecute(\n    body: ToolProxyParams,\n    requestOptions?: ComposioRequestOptions\n  ): Promise<ToolProxyResponse> {\n    const toolProxyParams = ToolProxyParamsSchema.safeParse(body);\n    if (!toolProxyParams.success) {\n      throw new ValidationError('Invalid tool proxy parameters', { cause: toolProxyParams.error });\n    }\n    // convert the headers and query to the composio format\n    // { name: string, type: 'header' | 'query', value: string }\n    const parameters: ComposioToolProxyParams.Parameter[] = [];\n    const parameterTypes = {\n      header: 'header',\n      query: 'query',\n    } as const;\n\n    if (toolProxyParams.data.parameters) {\n      parameters.push(\n        ...(toolProxyParams.data.parameters ?? []).map(value => ({\n          name: value.name,\n          type: value.in === 'header' ? parameterTypes.header : parameterTypes.query,\n          value: value.value.toString(),\n        }))\n      );\n    }","sourceCodeStart":1325,"sourceCodeEnd":1361,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/Tools.ts#L1325-L1361","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check error.cause ZodError issues for the exact failing fields and fix them","Supply all required fields (method, path) and shape headers/query per the current ToolProxyParamsSchema","Pre-validate with the exported schema in tests to catch drift after SDK upgrades"],"exampleFix":"// before\nawait tools.proxyExecute({ method: 'GET' }); // missing path\n\n// after\nawait tools.proxyExecute({ method: 'GET', path: '/v1/me', connectedAccountId });","handlingStrategy":"validation","validationCode":"import { ToolProxyParamsSchema } from '@composio/core';\nconst ok = ToolProxyParamsSchema.safeParse(proxyBody);\nif (!ok.success) {\n  throw new Error(ok.error.issues.map(i => `${i.path}: ${i.message}`).join('; '));\n}","typeGuard":"const hasMethodAndPath = (b: unknown): b is { method: string; path: string } =>\n  typeof (b as any)?.method === 'string' && typeof (b as any)?.path === 'string';","tryCatchPattern":"try {\n  await tools.proxyExecute(body);\n} catch (e) {\n  if (e instanceof ValidationError) console.error(e.cause?.issues);\n}","preventionTips":["Always include method and path","Reuse the exported schema for client-side pre-validation","Re-check the proxy schema after SDK upgrades"],"tags":["composio","zod","validation","proxy","typescript"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}