getProjectCommands
Retrieve merged command mappings for a specific project to understand available commands and their configurations.
Instructions
Return merged command mappings for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectName | Yes |
Implementation Reference
- src/server.ts:390-393 (handler)The inline handler function for the 'getProjectCommands' tool. It calls getMergedCommands to retrieve merged command mappings for the given project and returns the result as formatted JSON in the MCP response content.async ({ projectName }) => { const merged = await getMergedCommands(projectName); return { content: [{ type: "text", text: JSON.stringify({ projectName, commands: merged }, null, 2) }] }; }
- src/server.ts:385-388 (schema)The input schema definition for the tool, specifying a required 'projectName' string parameter using Zod validation.{ title: "Get project commands", description: "Return merged command mappings for a project", inputSchema: { projectName: z.string() }
- src/server.ts:383-394 (registration)The registration of the 'getProjectCommands' tool on the MCP server, including title, description, input schema, and inline handler.server.registerTool( "getProjectCommands", { title: "Get project commands", description: "Return merged command mappings for a project", inputSchema: { projectName: z.string() } }, async ({ projectName }) => { const merged = await getMergedCommands(projectName); return { content: [{ type: "text", text: JSON.stringify({ projectName, commands: merged }, null, 2) }] }; } );
- src/server.ts:171-174 (helper)Helper function that loads project command mappings from a JSON file and merges default commands with project-specific overrides.async function getMergedCommands(projectName: string): Promise<Record<string, string>> { const data = await loadJson<Record<string, Record<string, string>>>(PROJECT_COMMANDS_PATH, { default: {} }); return { ...(data.default || {}), ...(data[projectName] || {}) }; }