{"record":{"id":"51b3fd69bfa358e4","repo":"ComposioHQ/composio","slug":"invalid-arguments-for-local-tool-resolution-fina","errorCode":null,"errorMessage":"Invalid arguments for local tool ${resolution.finalSlug}: ${parsed.error.issues.map(issue => `${issue.path.join('.') || '<root>'}: ${issue.message}`).join('; ')}","messagePattern":"Invalid arguments for local tool (.+?): (.+?): (.+?)`\\)\\.join\\('; '\\)\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-local-tools/src/registry.ts","lineNumber":240,"sourceCode":"    version: 'local',\n  };\n};\n\nexport const executeLocalToolBySlug = async (\n  slug: string,\n  args: Record<string, unknown>\n): Promise<Record<string, unknown> | null> => {\n  const resolution = resolveLocalTool(slug, { includeUnsupported: true });\n  if (!resolution) return null;\n  if (!resolution.supported) {\n    throw new Error(\n      `Local tool ${resolution.finalSlug} is not supported on ${resolution.currentPlatform}. Supported platforms: ${formatSupportedPlatforms(resolution.tool.platforms)}.`\n    );\n  }\n\n  const parsed = resolution.tool.inputParams.safeParse(args);\n  if (!parsed.success) {\n    throw new Error(\n      `Invalid arguments for local tool ${resolution.finalSlug}: ${parsed.error.issues\n        .map(issue => `${issue.path.join('.') || '<root>'}: ${issue.message}`)\n        .join('; ')}`\n    );\n  }\n\n  return executeLocalTool(resolution.tool.execution, parsed.data as Record<string, unknown>, {\n    toolkit: resolution.toolkit,\n    tool: resolution.tool,\n    finalSlug: resolution.finalSlug,\n    platform: resolution.currentPlatform,\n  });\n};\n","sourceCodeStart":222,"sourceCodeEnd":254,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-local-tools/src/registry.ts#L222-L254","documentation":"The local tool was found and platform-supported, but the arguments object failed the tool's Zod inputParams validation. The message enumerates each issue as a path plus message, joining multiple issues with ';'. This mirrors schema validation failures on remote tools but happens client-side before spawning any process.","triggerScenarios":"Calling executeLocalToolBySlug with missing required fields, wrong types (e.g. string where number expected), or unknown/invalid enum values; passing a null recipient list to an iMessage send tool.","commonSituations":"Passing untyped JSON from an LLM tool call straight into a local tool; renaming a parameter and forgetting call sites; empty strings where the schema requires minLength.","solutions":["Read the issue paths in the message and fix the corresponding arguments","Inspect the tool's inputParams schema via the registry before calling","Validate args with the same Zod schema in your own code before invoking","If args come from an LLM, re-prompt with the schema on failure"],"exampleFix":"// before\nawait executeLocalToolBySlug('imessage__send', { recipient: '', });\n// after\nawait executeLocalToolBySlug('imessage__send', { recipient: '+15551234567', message: 'hi' });","handlingStrategy":"validation","validationCode":"const resolution = resolveLocalTool(slug);\nconst check = resolution ? resolution.tool.inputParams.safeParse(args) : null;\nif (!check?.success) console.error(check?.error.issues);","typeGuard":"const argsValid = (slug: string, args: unknown): args is Record<string, unknown> =>\n  resolveLocalTool(slug)?.tool.inputParams.safeParse(args).success === true;","tryCatchPattern":"try { ... } catch (e) { if (e instanceof Error && e.message.startsWith('Invalid arguments for local tool')) showZodIssues(e); }","preventionTips":["Validate with the tool's inputParams schema before execution","Type tool call arguments in agent harnesses"],"tags":["validation","zod","local-tools","typescript"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}