docs: document MCP server naming conventions and implement set-status

- Update architecture.mdc with file/function naming standards for MCP server components

- Update mcp.mdc with detailed naming conventions section

- Update task 23 to include naming convention details

- Update changeset to capture documentation changes

- Rename MCP tool files to follow kebab-case convention

- Implement set-task-status MCP command
This commit is contained in:
Eyal Toledano
2025-03-31 03:35:14 -04:00
parent 6d01ae3d47
commit 9582c0a91f
13 changed files with 110 additions and 348 deletions

View File

@@ -0,0 +1,50 @@
/**
* tools/parsePRD.js
* Tool to parse PRD document and generate tasks
*/
import { z } from "zod";
import {
handleApiResult,
createErrorResponse
} from "./utils.js";
import { parsePRDDirect } from "../core/task-master-core.js";
/**
* Register the parsePRD tool with the MCP server
* @param {Object} server - FastMCP server instance
*/
export function registerParsePRDTool(server) {
server.addTool({
name: "parse_prd_document",
description: "Parse PRD document and generate tasks",
parameters: z.object({
input: z.string().describe("Path to the PRD document file"),
numTasks: z.union([z.number(), z.string()]).optional().describe("Number of tasks to generate (default: 10)"),
output: z.string().optional().describe("Output path for tasks.json file (default: tasks/tasks.json)"),
projectRoot: z
.string()
.optional()
.describe(
"Root directory of the project (default: current working directory)"
),
}),
execute: async (args, { log }) => {
try {
log.info(`Parsing PRD document with args: ${JSON.stringify(args)}`);
// Call the direct function wrapper
const result = await parsePRDDirect(args, log);
// Log result
log.info(`${result.success ? `Successfully generated ${result.data?.taskCount || 0} tasks` : 'Failed to parse PRD'}`);
// Use handleApiResult to format the response
return handleApiResult(result, log, 'Error parsing PRD document');
} catch (error) {
log.error(`Error in parsePRD tool: ${error.message}`);
return createErrorResponse(error.message);
}
},
});
}