{"record":{"id":"6a8abca3f884aabc","repo":"eyaltoledano/claude-task-master","slug":"parameter-validation-failed-errors-join","errorCode":null,"errorMessage":"Parameter validation failed: ${errors.join('; ')}","messagePattern":"Parameter validation failed: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/prompt-manager.js","lineNumber":221,"sourceCode":"\t\t\t}\n\n\t\t\t// Range validation for numbers\n\t\t\tif (typeof value === 'number') {\n\t\t\t\tif (paramConfig.minimum !== undefined && value < paramConfig.minimum) {\n\t\t\t\t\terrors.push(\n\t\t\t\t\t\t`Parameter '${paramName}' must be >= ${paramConfig.minimum}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (paramConfig.maximum !== undefined && value > paramConfig.maximum) {\n\t\t\t\t\terrors.push(\n\t\t\t\t\t\t`Parameter '${paramName}' must be <= ${paramConfig.maximum}`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\tthrow new Error(`Parameter validation failed: ${errors.join('; ')}`);\n\t\t}\n\t}\n\n\t/**\n\t * Validate parameter type\n\t * @private\n\t */\n\tvalidateParameterType(value, expectedType) {\n\t\tswitch (expectedType) {\n\t\t\tcase 'string':\n\t\t\t\treturn typeof value === 'string';\n\t\t\tcase 'number':\n\t\t\t\treturn typeof value === 'number';\n\t\t\tcase 'boolean':\n\t\t\t\treturn typeof value === 'boolean';\n\t\t\tcase 'array':\n\t\t\t\treturn Array.isArray(value);\n\t\t\tcase 'object':","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/prompt-manager.js#L203-L239","documentation":"PromptManager.validateParameters throws this when a prompt template's declared parameters are missing, malformed, or fail type validation. It aggregates all individual parameter problems (missing parameter, unknown type, failed type check) into a single semicolon-joined message so the caller can fix everything at once. It surfaces at loadPrompt time, meaning the prompt cannot be used until its schema matches its parameters.","triggerScenarios":"Calling loadPrompt for a prompt whose parameter defaults or required flags are inconsistent, a parameter has an unsupported type string, or a default value does not match the declared type.","commonSituations":"Hand-edited prompt JSON/config files, adding a new parameter without updating defaults, typos in parameter type names, or upgrading prompts from an older format.","solutions":["Read the semicolon-joined list in the message; each entry names the failing parameter and reason.","Fix the parameter definitions (name, type, required flag) in the prompt config to match the expected schema.","Correct default values so they conform to the declared type.","Re-run loadPrompt to confirm all parameters validate."],"exampleFix":"// before\n{ \"name\": \"model\", \"type\": \"stringe\", \"required\": true }\n// after\n{ \"name\": \"model\", \"type\": \"string\", \"required\": true }","handlingStrategy":"validation","validationCode":"function validatePromptParams(prompt) {\n  const validTypes = ['string','number','boolean','object','array'];\n  const errors = [];\n  for (const p of prompt.parameters || []) {\n    if (!p.name) errors.push(`${prompt.id}: parameter missing name`);\n    if (!validTypes.includes(p.type)) errors.push(`${prompt.id}: ${p.name} invalid type ${p.type}`);\n    if (p.required === false && p.default === undefined) errors.push(`${prompt.id}: ${p.name} optional but no default`);\n  }\n  if (errors.length) throw new Error(errors.join('; '));\n}","typeGuard":"function hasValidParams(p) {\n  return Array.isArray(p?.parameters) &&\n    p.parameters.every(x => typeof x?.name === 'string' && typeof x?.type === 'string');\n}","tryCatchPattern":"try {\n  const prompt = await manager.loadPrompt(id, params);\n} catch (err) {\n  if (err.message.startsWith('Parameter validation failed')) {\n    // inspect err.message after the prefix for per-parameter issues\n    console.error('Fix prompt parameters:', err.message);\n  } else throw err;\n}","preventionTips":["Keep prompt parameter definitions in reviewed config files, not hand-edited ad hoc","Validate prompt configs in CI before deployment","Use consistent type names across all prompts","Pair every required flag with either required=true or a default"],"tags":["validation","parameters","prompts","configuration"],"backgroundTag":"parameter-validation-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}