FlowiseAI/Flowise · error · ToolInputParsingException
Received tool input did not match expected schema ${e}
Error message
Received tool input did not match expected schema ${e} What it means
Thrown as a ToolInputParsingException by OpenAPIToolkit/core.ts DynamicStructuredTool.call when parseWithTypeConversion(schema, arg) rejects the incoming argument against the tool's Zod schema. The exception message appends the Zod error and includes the serialized input as the second argument, signalling that the caller (typically an LLM agent) produced arguments that violate the generated tool schema for this OpenAPI endpoint.
Source
Thrown at packages/components/nodes/tools/OpenAPIToolkit/core.ts:179
this.strict = fields.strict
this.removeNulls = fields.removeNulls ?? false
}
async call(
arg: z.output<T>,
configArg?: RunnableConfig | Callbacks,
tags?: string[],
flowConfig?: { sessionId?: string; chatId?: string; input?: string; state?: ICommonObject }
): Promise<string> {
const config = parseCallbackConfigArg(configArg)
if (config.runName === undefined) {
config.runName = this.name
}
let parsed
try {
parsed = await parseWithTypeConversion(this.schema, arg)
} catch (e) {
throw new ToolInputParsingException(`Received tool input did not match expected schema ${e}`, JSON.stringify(arg))
}
const callbackManager_ = await CallbackManager.configure(
config.callbacks,
this.callbacks,
config.tags || tags,
this.tags,
config.metadata,
this.metadata,
{ verbose: this.verbose }
)
const runManager = await callbackManager_?.handleToolStart(
this.toJSON(),
typeof parsed === 'string' ? parsed : JSON.stringify(parsed),
undefined,
undefined,
undefined,
undefined,
config.runNameView on GitHub (pinned to abe4a8601a)
Solutions
- Inspect the Zod error embedded in the message to find the failing field and constraint.
- Correct the tool-call argument to satisfy the schema (right types, required fields present, valid enum values).
- If extra properties are rejected, either remove them from the agent output or disable strict mode on the tool.
- Improve the tool/parameter descriptions in the spec so the LLM supplies conformant arguments.
- Retry the agent turn with the error fed back so it self-corrects.
Example fix
// before: agent omitted required field
await tool.call({ query: 'foo' }) // schema requires { query: string, limit: number }
// after
await tool.call({ query: 'foo', limit: 10 }) Defensive patterns
Strategy: try-catch
Validate before calling
import { safeParseTyped } from 'zod/v3'
// pre-validate against the tool's schema before calling
function matchesSchema(schema: any, arg: unknown): boolean {
return schema.safeParse(arg).success === true
} Type guard
null
Try / catch
import { ToolInputParsingException } from '../OpenAPIToolkit/core'
try {
await tool.call(arg)
} catch (e) {
if (e instanceof ToolInputParsingException) {
// parse the embedded Zod error, feed back to the agent for retry
} else throw e
} Prevention
- Improve parameter descriptions in the spec so the LLM emits conformant args.
- Run schema.safeParse(arg) before calling and report issues to the agent.
- If extra fields are rejected, disable strict mode on the tool.
- After spec changes, re-test agent tool calls end-to-end.
When it happens
Trigger: The LLM emits a JSON argument missing a required field, with a wrong type (e.g. string where a number is expected), or with extra unknown fields when strict mode is on; the agent sends a plain string where an object is expected; enum constraint violated.
Common situations: Loosely-prompted agent generates best-effort arguments that do not match the endpoint schema; the OpenAPI spec declares a parameter as required but the model omits it; a recent spec change tightened the schema and stale agent behavior breaks; strict:true causing extra-property rejection.
Related errors
- Error parsing Zod Schema: ${exception}
- Received tool input did not match expected schema: ${JSON.st
- Received tool input did not match expected schema: ${JSON.st
- Received tool input did not match expected schema
- Unsupported type: ${typeInfo.base}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/2c5e9ba4fda5aaff.
Report an issue: GitHub.