{"record":{"id":"c9619b6ca42dafc7","repo":"n8n-io/n8n","slug":"model-did-not-provide-parameter-parameter-name","errorCode":null,"errorMessage":"Model did not provide parameter '${parameter.name}' which is required and must be present in the input","messagePattern":"Model did not provide parameter '(.+?)' which is required and must be present in the input","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts","lineNumber":751,"sourceCode":"\t\t\t\t\t\t\tdataFromModel = { [toolParameters[0].name]: query };\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t\t\t\t`Input is not a valid JSON: ${error.message}`,\n\t\t\t\t\t\t\t\t{ itemIndex },\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdataFromModel = query;\n\t\t\t\t}\n\n\t\t\t\tfor (const parameter of toolParameters) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tparameter.required &&\n\t\t\t\t\t\t(dataFromModel[parameter.name] === undefined || dataFromModel[parameter.name] === null)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new NodeOperationError(\n\t\t\t\t\t\t\tctx.getNode(),\n\t\t\t\t\t\t\t`Model did not provide parameter '${parameter.name}' which is required and must be present in the input`,\n\t\t\t\t\t\t\t{ itemIndex },\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const parameter of toolParameters) {\n\t\t\t\t\tlet argument = dataFromModel[parameter.name];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\targument &&\n\t\t\t\t\t\tparameter.type === 'json' &&\n\t\t\t\t\t\t!['qsRaw', 'headersRaw', 'bodyRaw'].includes(parameter.key ?? '') &&\n\t\t\t\t\t\ttypeof argument !== 'object'\n\t\t\t\t\t) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\targument = jsonParse(String(argument));","sourceCodeStart":733,"sourceCodeEnd":769,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/utils.ts#L733-L769","documentation":"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.","triggerScenarios":"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.","commonSituations":"Models trimming arguments they deem unnecessary; parameter names that are ambiguous; required flags set on fields the model cannot infer from context.","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."],"exampleFix":"// before: parameter { name: 'query', required: true } omitted by model → throws\n// after: relax the constraint or guide the model\n{ name: 'query', required: false }\n// or enrich description: 'query (REQUIRED): the search term, never omit'","handlingStrategy":"validation","validationCode":"for (const p of toolParameters) {\n  if (p.required && (dataFromModel[p.name] === undefined || dataFromModel[p.name] === null)) {\n    dataFromModel[p.name] = p.defaultValue ?? ''; // supply a default before running\n  }\n}","typeGuard":"function hasAllRequired(params: ToolParameter[], data: IDataObject): boolean {\n  return params.filter(p => p.required).every(p => data[p.name] !== undefined && data[p.name] !== null);\n}","tryCatchPattern":"if (!hasAllRequired(toolParameters, dataFromModel)) { /* re-prompt model */ }","preventionTips":["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."],"tags":["ai-tool","llm-input","validation","http-request-tool"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}