fix(mcp): make projectRoot optional in all MCP tools

- Update all tool definitions to use z.string().optional() for projectRoot
- Fix direct function implementations to use findTasksJsonPath(args, log) pattern
- Enables consistent project root detection without requiring explicit params
- Update changeset to document these improvements

This change ensures MCP tools work properly with the smart project root
detection system, removing the need for explicit projectRoot parameters in
client applications. Improves usability and reduces integration friction.
This commit is contained in:
Eyal Toledano
2025-04-01 03:12:44 -04:00
parent 281c476738
commit 6161febbde
22 changed files with 27 additions and 37 deletions

View File

@@ -22,7 +22,7 @@ export function registerRemoveDependencyTool(server) {
id: z.string().describe("Task ID to remove dependency from"),
dependsOn: z.string().describe("Task ID to remove as a dependency"),
file: z.string().optional().describe("Path to the tasks file (default: tasks/tasks.json)"),
projectRoot: z.string().describe("Root directory of the project (default: current working directory)")
projectRoot: z.string().optional().describe("Root directory of the project (default: current working directory)")
}),
execute: async (args, { log }) => {
try {