diff --git a/.changeset/two-bats-smoke.md b/.changeset/two-bats-smoke.md index ff2560b3..f9463947 100644 --- a/.changeset/two-bats-smoke.md +++ b/.changeset/two-bats-smoke.md @@ -4,6 +4,10 @@ - Adjusts the MCP server invokation in the mcp.json we ship with `task-master init`. Fully functional now. +- Rename MCP tools to better align with API conventions and natural language in client chat: + - Rename `list-tasks` to `get-tasks` for more intuitive client requests like "get my tasks" + - Rename `show-task` to `get-task` for consistency with GET-based API naming conventions + - Implement robust project root detection with a hierarchical precedence system: - Environment variable override (TASK_MASTER_PROJECT_ROOT) - Explicitly provided project root (--project-root parameter) @@ -31,7 +35,7 @@ - Implement update-subtask MCP command for appending information to specific subtasks - Implement generate MCP command for creating individual task files from tasks.json - Implement set-status MCP command for updating task status -- Implement show-task MCP command for displaying detailed task information +- Implement get-task MCP command for displaying detailed task information (renamed from show-task) - Implement next-task MCP command for finding the next task to work on - Implement expand-task MCP command for breaking down tasks into subtasks - Implement add-task MCP command for creating new tasks using AI assistance @@ -45,7 +49,9 @@ - Implement fix-dependencies MCP command for automatically fixing invalid dependencies - Implement complexity-report MCP command for displaying task complexity analysis reports - Implement add-dependency MCP command for creating dependency relationships between tasks +- Implement get-tasks MCP command for listing all tasks (renamed from list-tasks) - Document MCP server naming conventions in architecture.mdc and mcp.mdc files (file names use kebab-case, direct functions use camelCase with Direct suffix, tool registration functions use camelCase with Tool suffix, and MCP tool names use snake_case) +- Update MCP tool naming to follow more intuitive conventions that better align with natural language requests in client chat applications - Enhance task show view with a color-coded progress bar for visualizing subtask completion percentage - Add "cancelled" status to UI module status configurations for marking tasks as cancelled without deletion - Improve MCP server resource documentation with comprehensive implementation examples and best practices diff --git a/mcp-server/src/tools/show-task.js b/mcp-server/src/tools/get-task.js similarity index 68% rename from mcp-server/src/tools/show-task.js rename to mcp-server/src/tools/get-task.js index a29574b5..b619f002 100644 --- a/mcp-server/src/tools/show-task.js +++ b/mcp-server/src/tools/get-task.js @@ -1,6 +1,6 @@ /** - * tools/show-task.js - * Tool to show task details by ID + * tools/get-task.js + * Tool to get task details by ID */ import { z } from "zod"; @@ -11,15 +11,15 @@ import { import { showTaskDirect } from "../core/task-master-core.js"; /** - * Register the show-task tool with the MCP server + * Register the get-task tool with the MCP server * @param {Object} server - FastMCP server instance */ export function registerShowTaskTool(server) { server.addTool({ - name: "show_task", - description: "Display detailed information about a specific task", + name: "get_task", + description: "Get detailed information about a specific task", parameters: z.object({ - id: z.string().describe("Task ID to show"), + id: z.string().describe("Task ID to get"), file: z.string().optional().describe("Path to the tasks file"), projectRoot: z .string() @@ -30,7 +30,7 @@ export function registerShowTaskTool(server) { }), execute: async (args, { log }) => { try { - log.info(`Showing task details for ID: ${args.id}`); + log.info(`Getting task details for ID: ${args.id}`); // Call the direct function wrapper const result = await showTaskDirect(args, log); @@ -39,14 +39,14 @@ export function registerShowTaskTool(server) { if (result.success) { log.info(`Successfully retrieved task details for ID: ${args.id}${result.fromCache ? ' (from cache)' : ''}`); } else { - log.error(`Failed to show task: ${result.error.message}`); + log.error(`Failed to get task: ${result.error.message}`); } // Use handleApiResult to format the response return handleApiResult(result, log, 'Error retrieving task details'); } catch (error) { - log.error(`Error in show-task tool: ${error.message}`); - return createErrorResponse(`Failed to show task: ${error.message}`); + log.error(`Error in get-task tool: ${error.message}`); + return createErrorResponse(`Failed to get task: ${error.message}`); } }, }); diff --git a/mcp-server/src/tools/list-tasks.js b/mcp-server/src/tools/get-tasks.js similarity index 77% rename from mcp-server/src/tools/list-tasks.js rename to mcp-server/src/tools/get-tasks.js index 8f291694..52fd5dbe 100644 --- a/mcp-server/src/tools/list-tasks.js +++ b/mcp-server/src/tools/get-tasks.js @@ -1,6 +1,6 @@ /** - * tools/listTasks.js - * Tool to list all tasks from Task Master + * tools/get-tasks.js + * Tool to get all tasks from Task Master */ import { z } from "zod"; @@ -11,13 +11,13 @@ import { import { listTasksDirect } from "../core/task-master-core.js"; /** - * Register the listTasks tool with the MCP server + * Register the getTasks tool with the MCP server * @param {Object} server - FastMCP server instance */ export function registerListTasksTool(server) { server.addTool({ - name: "list-tasks", - description: "List all tasks from Task Master", + name: "get-tasks", + description: "Get all tasks from Task Master", parameters: z.object({ status: z.string().optional().describe("Filter tasks by status"), withSubtasks: z @@ -34,16 +34,16 @@ export function registerListTasksTool(server) { }), execute: async (args, { log }) => { try { - log.info(`Listing tasks with filters: ${JSON.stringify(args)}`); + log.info(`Getting tasks with filters: ${JSON.stringify(args)}`); // Call core function - args contains projectRoot which is handled internally const result = await listTasksDirect(args, log); // Log result and use handleApiResult utility log.info(`Retrieved ${result.success ? (result.data?.tasks?.length || 0) : 0} tasks`); - return handleApiResult(result, log, 'Error listing tasks'); + return handleApiResult(result, log, 'Error getting tasks'); } catch (error) { - log.error(`Error listing tasks: ${error.message}`); + log.error(`Error getting tasks: ${error.message}`); return createErrorResponse(error.message); } }, diff --git a/mcp-server/src/tools/index.js b/mcp-server/src/tools/index.js index 69d66ee0..6c86de79 100644 --- a/mcp-server/src/tools/index.js +++ b/mcp-server/src/tools/index.js @@ -3,7 +3,7 @@ * Export all Task Master CLI tools for MCP server */ -import { registerListTasksTool } from "./list-tasks.js"; +import { registerListTasksTool } from "./get-tasks.js"; import logger from "../logger.js"; import { registerSetTaskStatusTool } from "./set-task-status.js"; import { registerParsePRDTool } from "./parse-prd.js"; @@ -11,7 +11,7 @@ import { registerUpdateTool } from "./update.js"; import { registerUpdateTaskTool } from "./update-task.js"; import { registerUpdateSubtaskTool } from "./update-subtask.js"; import { registerGenerateTool } from "./generate.js"; -import { registerShowTaskTool } from "./show-task.js"; +import { registerShowTaskTool } from "./get-task.js"; import { registerNextTaskTool } from "./next-task.js"; import { registerExpandTaskTool } from "./expand-task.js"; import { registerAddTaskTool } from "./add-task.js";