chore/doc: renames list-tasks to get-tasks and show-tasks to get-tasks in the mcp tools to follow api conventions and likely natural language used (get my tasks). also updates changeset.

This commit is contained in:
Eyal Toledano
2025-04-01 02:45:42 -04:00
parent 78840a1f45
commit 281c476738
4 changed files with 27 additions and 21 deletions

View File

@@ -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}`);
}
},
});

View File

@@ -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);
}
},

View File

@@ -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";