eyaltoledano/claude-task-master · error
MISSING_ARGUMENT
MISSING_ARGUMENT
Error message
tasksJsonPath is required
What it means
useTagDirect is the MCP direct-function wrapper for switching the active task tag. Before doing any work it requires the absolute path to the tasks.json file; if the caller omits tasksJsonPath it fails fast with MISSING_ARGUMENT so no tag operations run against an unknown file.
Source
Thrown at mcp-server/src/core/direct-functions/use-tag.js:43
// Destructure expected args
const { tasksJsonPath, name, projectRoot } = args;
const { session } = context;
// Enable silent mode to prevent console logs from interfering with JSON response
enableSilentMode();
// Create logger wrapper using the utility
const mcpLog = createLogWrapper(log);
try {
// Check if tasksJsonPath was provided
if (!tasksJsonPath) {
log.error('useTagDirect called without tasksJsonPath');
disableSilentMode();
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'tasksJsonPath is required'
}
};
}
// Check required parameters
if (!name || typeof name !== 'string') {
log.error('Missing required parameter: name');
disableSilentMode();
return {
success: false,
error: {
code: 'MISSING_PARAMETER',
message: 'Tag name is required and must be a string'
}
};
}
View on GitHub (pinned to c0c98d367c)
Solutions
- Pass tasksJsonPath (absolute path to tasks.json) in the tool call arguments
- In the MCP tool registration, default tasksJsonPath from the project root if the client omits it
- Log the received arguments at the tool layer to confirm which parameter name the client is actually sending
Example fix
// before
await useTagDirect({ name: 'feature' });
// after
await useTagDirect({ name: 'feature', tasksJsonPath: '/path/to/project/.taskmaster/tasks.json' }); Defensive patterns
Strategy: validation
Validate before calling
function assertTasksJsonPath(args) {
if (!args?.tasksJsonPath || typeof args.tasksJsonPath !== 'string') {
throw new Error('tasksJsonPath is required (absolute path to tasks.json)');
}
} Type guard
function hasTasksJsonPath(a): a is { tasksJsonPath: string } & Record<string, unknown> {
return typeof a === 'object' && a !== null && typeof (a as any).tasksJsonPath === 'string' && (a as any).tasksJsonPath.length > 0;
} Try / catch
try {
const res = await useTagDirect(args);
if (!res.success && res.error?.code === 'MISSING_ARGUMENT') {
// resolve and retry with explicit path
}
} catch (e) { /* handle */ } Prevention
- Always pass an absolute tasksJsonPath resolved from the project root
- Validate tool arguments against the tool's input schema client-side
- Default tasksJsonPath in your MCP tool wrapper
When it happens
Trigger: Calling the use-tag MCP tool (or useTagDirect directly) without a tasksJsonPath argument, e.g. the tool handler forgot to resolve the workspace root into a tasks.json path before invoking this function.
Common situations: MCP client omits the optional-looking argument; a tool registration passes args through without defaulting tasksJsonPath from the session/project root; automated scripts calling the direct function API with only a tag name.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/281a0bdcb44726c5.
Report an issue: GitHub.