eyaltoledano/claude-task-master · error
DIRECT_FUNCTION_SETUP_ERROR
DIRECT_FUNCTION_SETUP_ERROR
Error message
error.message || 'Unknown setup error'
What it means
Outer catch of updateSubtaskByIdDirect: exceptions thrown during function setup (before/around the main guarded block — logger initialization, silent-mode handling, argument destructuring) are returned as DIRECT_FUNCTION_SETUP_ERROR with error.message or 'Unknown setup error'. It signals infrastructure/wiring failure rather than a problem with the subtask update itself.
Source
Thrown at mcp-server/src/core/direct-functions/update-subtask-by-id.js:157
error: {
code: 'UPDATE_SUBTASK_CORE_ERROR',
message: error.message || 'Unknown error updating subtask'
}
};
} finally {
if (!wasSilent && isSilentMode()) {
disableSilentMode();
}
}
} catch (error) {
logWrapper.error(
`Setup error in updateSubtaskByIdDirect: ${error.message}`
);
if (isSilentMode()) disableSilentMode();
return {
success: false,
error: {
code: 'DIRECT_FUNCTION_SETUP_ERROR',
message: error.message || 'Unknown setup error'
}
};
}
}
View on GitHub (pinned to c0c98d367c)
Solutions
- Inspect error.message in the returned result for the setup exception.
- Reinstall/rebuild dependencies so @tm/core and the MCP server versions match.
- Verify any custom logWrapper you pass implements the used methods (error, success, etc.).
- Run the flow outside MCP (call the direct function in a script) to capture the full stack.
Example fix
// before
const logWrapper = { info: console.log }; // missing .error
// after
const logWrapper = getMcpLogger(session, 'update-subtask'); // full logger Defensive patterns
Strategy: try-catch
Validate before calling
import { getMcpLogger, isSilentMode, disableSilentMode } from '../tools/utils.js';
for (const [name, fn] of Object.entries({ getMcpLogger, isSilentMode, disableSilentMode })) {
if (typeof fn !== 'function') throw new Error(`Missing helper: ${name} — check @tm/core install`);
} Type guard
function isResultOk(r) { return r !== null && typeof r === 'object' && r.success === true; } Try / catch
const res = await updateSubtaskByIdDirect(args);
if (!res.success && res.error.code === 'DIRECT_FUNCTION_SETUP_ERROR') {
console.error('Setup failure:', res.error.message);
// reinstall deps / fix logger wiring, then retry once
} Prevention
- Import logger and silent-mode helpers from a single vetted module
- Smoke-test direct functions outside MCP after every dependency upgrade
- Ensure any injected logWrapper implements the full interface (error, success, info)
When it happens
Trigger: Logger wrapper undefined due to a bad import, an exception while toggling silent mode, or a TypeError in setup code when required helpers are missing from the installed tm-core version.
Common situations: Partial npm install leaving mcp-server and tm-core out of sync; monkey-patched or custom logger passed to the direct function that throws on init.
Related errors
- SET_STATUS_ERROR
- UPDATE_SUBTASK_CORE_ERROR
- DIRECT_FUNCTION_SETUP_ERROR
- projectRoot is required in args to resolve project paths
- MCP provider requires session object
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/6a5391d167bf2745.
Report an issue: GitHub.