n8n-io/n8n · error · NodeOperationError
Model did not provide parameter '${parameter.name}' which is
Error message
Model did not provide parameter '${parameter.name}' which is required and must be present in the input What it means
Thrown by configureToolFunction when iterating tool parameters: a parameter marked required is absent (undefined or null) from the model-supplied input object. This is a contract enforcement — the tool schema promised a required field and the model did not deliver it.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts:751
dataFromModel = { [toolParameters[0].name]: query };
} else {
throw new NodeOperationError(
ctx.getNode(),
`Input is not a valid JSON: ${error.message}`,
{ itemIndex },
);
}
}
} else {
dataFromModel = query;
}
for (const parameter of toolParameters) {
if (
parameter.required &&
(dataFromModel[parameter.name] === undefined || dataFromModel[parameter.name] === null)
) {
throw new NodeOperationError(
ctx.getNode(),
`Model did not provide parameter '${parameter.name}' which is required and must be present in the input`,
{ itemIndex },
);
}
}
for (const parameter of toolParameters) {
let argument = dataFromModel[parameter.name];
if (
argument &&
parameter.type === 'json' &&
!['qsRaw', 'headersRaw', 'bodyRaw'].includes(parameter.key ?? '') &&
typeof argument !== 'object'
) {
try {
argument = jsonParse(String(argument));View on GitHub (pinned to 5ac6606e81)
Solutions
- Mark the parameter as optional if the workflow can function without it.
- Strengthen the parameter description so the model understands it must always supply the value.
- Provide a sensible default in the tool description so the model fills it.
- Switch to a structured tool schema so the agent framework validates required fields upfront.
Example fix
// before: parameter { name: 'query', required: true } omitted by model → throws
// after: relax the constraint or guide the model
{ name: 'query', required: false }
// or enrich description: 'query (REQUIRED): the search term, never omit' Defensive patterns
Strategy: validation
Validate before calling
for (const p of toolParameters) {
if (p.required && (dataFromModel[p.name] === undefined || dataFromModel[p.name] === null)) {
dataFromModel[p.name] = p.defaultValue ?? ''; // supply a default before running
}
} Type guard
function hasAllRequired(params: ToolParameter[], data: IDataObject): boolean {
return params.filter(p => p.required).every(p => data[p.name] !== undefined && data[p.name] !== null);
} Try / catch
if (!hasAllRequired(toolParameters, dataFromModel)) { /* re-prompt model */ } Prevention
- Only mark parameters required when truly necessary.
- Provide defaults in the description for borderline-required fields.
- Use a structured-tool schema so the framework enforces required fields with a clear error.
When it happens
Trigger: The LLM omits a required argument; the model sends an empty string or null for a required field; parameter names in the schema don't match what the model emits due to case/spacing.
Common situations: Models trimming arguments they deem unnecessary; parameter names that are ambiguous; required flags set on fields the model cannot infer from context.
Related errors
- Parameter ${parameter.name} is not a valid JSON: ${error.mes
- Input is not a valid JSON: ${error.message}
- The type ${genericType} is not supported
- The response type must be a string. Received: ${typeof respo
- The response type must be an object or an array of objects
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/c9619b6ca42dafc7.
Report an issue: GitHub.