eyaltoledano/claude-task-master · warning
INPUT_VALIDATION_ERROR
INPUT_VALIDATION_ERROR
Error message
Task ID is required
What it means
removeTaskDirect requires an `id` parameter specifying which task(s) to remove. When the MCP client omits or passes an empty/falsy `id`, the function short-circuits before any file access and returns this INPUT_VALIDATION_ERROR instead of attempting the removal.
Source
Thrown at mcp-server/src/core/direct-functions/remove-task.js:51
// Check if tasksJsonPath was provided
if (!tasksJsonPath) {
log.error('removeTaskDirect called without tasksJsonPath');
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'tasksJsonPath is required'
}
};
}
// Validate task ID parameter
if (!id) {
log.error('Task ID is required');
return {
success: false,
error: {
code: 'INPUT_VALIDATION_ERROR',
message: 'Task ID is required'
}
};
}
// Split task IDs if comma-separated
const taskIdArray = id.split(',').map((taskId) => taskId.trim());
log.info(
`Removing ${taskIdArray.length} task(s) with ID(s): ${taskIdArray.join(', ')} from ${tasksJsonPath}${tag ? ` in tag '${tag}'` : ''}`
);
// Validate all task IDs exist before proceeding
const data = readJSON(tasksJsonPath, projectRoot, tag);
if (!data || !data.tasks) {
return {
success: false,
error: {View on GitHub (pinned to c0c98d367c)
Solutions
- Pass the task id (or comma-separated list of ids) explicitly in the remove_task tool call, e.g. id="5" or id="5,6"
- Regenerate/refresh the MCP client so it uses the current remove_task input schema where `id` is required
- If an agent is calling the tool, instruct it to resolve the task id first (e.g. via get_tasks) before removing
- Check argument serialization so the id is at the top level of the args object, not nested
Example fix
// before
await client.callTool('remove_task', {});
// after
await client.callTool('remove_task', { id: '5', projectRoot: '/path/to/project' }); Defensive patterns
Strategy: validation
Validate before calling
const id = args?.id;
if (typeof id !== 'string' || id.trim().length === 0) {
throw new Error('remove_task requires a non-empty id, e.g. "5" or "5,6"');
} Type guard
function hasTaskId(args) {
return typeof args === 'object' && args !== null && 'id' in args &&
typeof args.id === 'string' && args.id.trim().length > 0;
} Try / catch
try {
const res = await client.callTool('remove_task', { id });
if (res.error?.code === 'INPUT_VALIDATION_ERROR') {
console.error('Missing task id — pass id like "5" or "5,6"');
}
} catch (e) {
console.error('remove_task failed:', e.message);
} Prevention
- Always resolve the task id (via get_tasks/list) before calling remove_task
- Validate required tool arguments in a thin wrapper around callTool
- Keep MCP client schemas regenerated from the current server tool definitions
When it happens
Trigger: Calling the remove_task MCP tool without the `id` argument, with `id: null`/`undefined`/empty string, or a tool schema/client that fails to forward the id parameter.
Common situations: A client built against an older tool schema that lacked `id`; an LLM agent omitting optional-looking parameters; hand-rolled MCP requests missing required fields; id accidentally nested inside another object instead of top-level.
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/5d470f4908ebf164.
Report an issue: GitHub.