fix: add rest of tools that need wrapper

This commit is contained in:
Ralph Khreish
2025-05-02 19:56:13 +02:00
parent d18351dc38
commit 8f8a3dc45d
4 changed files with 25 additions and 40 deletions

View File

@@ -8,6 +8,7 @@ import { handleApiResult, createErrorResponse } from './utils.js';
import { updateSubtaskByIdDirect } from '../core/task-master-core.js';
import { findTasksJsonPath } from '../core/utils/path-utils.js';
import path from 'path';
import { withNormalizedProjectRoot } from '../core/utils/project-utils.js';
/**
* Register the update-subtask tool with the MCP server
@@ -34,7 +35,7 @@ export function registerUpdateSubtaskTool(server) {
.string()
.describe('The directory of the project. Must be an absolute path.')
}),
execute: async (args, { log, session }) => {
execute: withNormalizedProjectRoot(async (args, { log, session }) => {
const toolName = 'update_subtask';
try {
log.info(`Updating subtask with args: ${JSON.stringify(args)}`);
@@ -95,6 +96,6 @@ export function registerUpdateSubtaskTool(server) {
`Internal tool error (${toolName}): ${error.message}`
);
}
}
})
});
}