eyaltoledano/claude-task-master · error
INPUT_VALIDATION_ERROR
INPUT_VALIDATION_ERROR
Error message
No task ID specified. Please provide a task ID to update.
What it means
updateTaskByIdDirect requires a task `id` to know which task to update; when it is missing it returns INPUT_VALIDATION_ERROR immediately. This is the first guard in the function, before checking that a prompt or metadata was supplied.
Source
Thrown at mcp-server/src/core/direct-functions/update-task-by-id.js:59
projectRoot,
tag
} = args;
const logWrapper = createLogWrapper(log);
try {
logWrapper.info(
`Updating task by ID via direct function. ID: ${id}, ProjectRoot: ${projectRoot}`
);
// Check required parameters (id and prompt)
if (!id) {
const errorMessage =
'No task ID specified. Please provide a task ID to update.';
logWrapper.error(errorMessage);
return {
success: false,
error: { code: 'INPUT_VALIDATION_ERROR', message: errorMessage }
};
}
// At least prompt or metadata is required (validated in MCP tool layer)
if (!prompt && !metadata) {
const errorMessage =
'No prompt or metadata specified. Please provide a prompt with new information or metadata for the task update.';
logWrapper.error(errorMessage);
return {
success: false,
error: { code: 'INPUT_VALIDATION_ERROR', message: errorMessage }
};
}
// Parse taskId - handle numeric, alphanumeric, and subtask IDs
let taskId;
if (typeof id === 'string') {
// Keep ID as string - supports numeric (1, 2), alphanumeric (TAS-49, JIRA-123), and subtask IDs (1.2, TAS-49.1)View on GitHub (pinned to c0c98d367c)
Solutions
- Pass the task ID explicitly, e.g. { id: '5', prompt: 'Update notes' } (also accepts '5.2' style for subtasks via the same path).
- Ensure your MCP client schema marks id as required so the model/transport always includes it.
- Confirm the id variable is populated at the call site (log arguments before invoking).
Example fix
// before
await updateTask({ prompt: 'New details' });
// after
await updateTask({ id: '5', prompt: 'New details' }); Defensive patterns
Strategy: validation
Validate before calling
if (typeof id !== 'string' && typeof id !== 'number') throw new Error('task id is required');
if (String(id).trim() === '') throw new Error('task id cannot be empty'); Type guard
function hasTaskId(a) { return a.id !== null && a.id !== undefined && String(a.id).trim().length > 0; } Prevention
- Mark id as required in your MCP client tool schema
- Validate the full argument object at the boundary before every tool call
- Avoid generic arg builders that silently drop falsy fields
When it happens
Trigger: Calling the update-task-by-id MCP tool without the id argument, id: null/undefined, or an empty string; a client-side argument builder that omits falsy values.
Common situations: Agents composing tool calls dynamically and dropping the id field; clients filtering arguments against an outdated schema where id was assumed optional.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/4f74e7022b406610.
Report an issue: GitHub.