ComposioHQ/composio · error · ValidationError
Invalid tool execute session parameters
Error message
Invalid tool execute session parameters
What it means
ValidationError('Invalid tool execute session parameters') is thrown by executeSessionTool when body fails ToolExecuteMetaParamsSchema.safeParse. This is the session-scoped execution path (used by executeBackendSessionTool and executeToolFn); validation happens client-side before the request is sent, with the ZodError attached as cause.
Source
Thrown at ts/packages/core/src/models/Tools.ts:1194
* @param {string} toolSlug - The slug of the tool to execute
* @param {ToolExecuteMetaParams} body - The execution parameters
* @param {string} body.sessionId - The session id to execute the tool for
* @param {Record<string, unknown>} body.arguments - The input to pass to the tool
* @param {SessionExecuteMetaModifiers} modifiers - The modifiers to apply to the tool
* @param {Tool} tool - Optional tool schema used to resolve toolkit metadata for modifiers
* @returns {Promise<ToolExecuteResponse>} The response from the tool execution
*/
async executeSessionTool(
toolSlug: string,
body: ToolExecuteMetaParams,
modifiers?: SessionExecuteMetaModifiers,
tool?: Tool,
options?: ToolRouterSessionExecuteOptions,
requestOptions?: ComposioRequestOptions
): Promise<ToolExecuteResponse> {
const executeParams = ToolExecuteMetaParamsSchema.safeParse(body);
if (!executeParams.success) {
throw new ValidationError('Invalid tool execute session parameters', {
cause: executeParams.error,
});
}
let modifiedParams = body.arguments ?? {};
const toolkitSlug = tool?.toolkit?.slug ?? 'composio';
if (tool) {
const fileModifiedParams = await this.applyFileUploadModifiers(
tool,
{
toolSlug,
toolkitSlug,
params: { arguments: modifiedParams },
},
undefined,
requestOptions
);View on GitHub (pinned to 64b1b85502)
Solutions
- Read error.cause ZodError issues and correct the named fields/types
- Ensure body.arguments is a plain object (defaults to {} when omitted, so a wrong type is the usual culprit)
- Normalize LLM tool-call arguments (JSON.parse, strip unknown keys) before invoking session execution
Example fix
// before
await session.executeToolFn(tool, { arguments: JSON.stringify(args) });
// after
await session.executeToolFn(tool, { arguments: args }); Defensive patterns
Strategy: validation
Validate before calling
import { ToolExecuteMetaParamsSchema } from '@composio/core';
const ok = ToolExecuteMetaParamsSchema.safeParse(body);
if (!ok.success) {
throw new Error(ok.error.issues.map(i => `${i.path}: ${i.message}`).join('; '));
} Type guard
const isPlainObject = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null;
Try / catch
try {
await executeSessionTool(body, tool, options);
} catch (e) {
if (e instanceof ValidationError && /session parameters/.test(e.message)) {
// normalize body per e.cause issues and retry
}
} Prevention
- Normalize LLM tool-call arguments (JSON.parse, strip unknown keys) before session execute
- Keep session metadata strongly typed
- Test with representative payloads in CI
When it happens
Trigger: Calling executeSessionTool (directly or via a tool-router session's executeToolFn) with a body violating ToolExecuteMetaParamsSchema — e.g. arguments of the wrong type, invalid metadata fields, or unexpected keys.
Common situations: Session/agent flows where arguments come from an LLM tool call as a JSON string or contain invalid nested values; passing execute options in the body position; SDK upgrades tightening the meta-params schema.
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
- Invalid tool execute parameters
- Invalid proxy execute parameters
- Invalid tool proxy parameters
- Invalid parameters passed to set webhook subscription
- Invalid parameters passed to list triggers
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/f7610f788ed969a8.
Report an issue: GitHub.