Skip to main content
Glama

specs-workflow

Streamline software project documentation by managing requirements, design, and task workflows. Initialize, check, skip, confirm, or complete tasks in batches with structured operations.

Instructions

Manage intelligent writing workflow for software project requirements, design, and task documents. Supports initialization, checking, skipping, confirmation, and task completion operations (single or batch).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoOperation parameters
pathYesSpecification directory path (e.g., /Users/link/specs-mcp/batch-log-test)

Implementation Reference

  • Zod-based input schema defining the parameters for the 'specs-workflow' tool: path to spec directory and optional action (init, check, skip, confirm, complete_task).
    const inputSchema = { path: z.string().describe('Specification directory path (e.g., /Users/link/specs-mcp/batch-log-test)'), action: z.object({ type: z.enum(['init', 'check', 'skip', 'confirm', 'complete_task']).describe('Operation type'), featureName: z.string().optional().describe('Feature name (required for init)'), introduction: z.string().optional().describe('Feature introduction (required for init)'), taskNumber: z.union([ z.string(), z.array(z.string()) ]).optional().describe('Task number(s) to mark as completed (required for complete_task). Can be a single string or an array of strings') }).optional().describe('Operation parameters') };
  • Registration call for the 'specs-workflow' tool on MCP server, specifying name, title, description, inputSchema reference, and annotations.
    server.registerTool( 'specs-workflow', { title: 'Intelligent Specification Workflow Tool', // Added title property description: 'Manage intelligent writing workflow for software project requirements, design, and task documents. Supports initialization, checking, skipping, confirmation, and task completion operations (single or batch).', inputSchema, annotations: { progressReportingHint: true, longRunningHint: true, readOnlyHint: false, // This tool modifies files idempotentHint: false // Operation is not idempotent } }, // eslint-disable-next-line @typescript-eslint/no-unused-vars
  • Handler function that invokes executeWorkflow with parsed args, converts result to MCP format via toMcpResult, and returns structured content or error response.
    async (args, _extra) => { try { // Temporarily not using progress callback, as MCP SDK type definitions may differ const onProgress = undefined; // Execute workflow const workflowResult = await executeWorkflow({ path: args.path, action: args.action }, onProgress); // Use standard MCP format converter const mcpResult = toMcpResult(workflowResult); // Return format that meets SDK requirements, including structuredContent const callToolResult: Record<string, unknown> = { content: mcpResult.content, isError: mcpResult.isError }; if (mcpResult.structuredContent !== undefined) { callToolResult.structuredContent = mcpResult.structuredContent; } // Type assertion to satisfy MCP SDK requirements return callToolResult as { content: Array<{ type: 'text'; text: string; [x: string]: unknown; }>; isError?: boolean; [x: string]: unknown; }; } catch (error) { // Error handling must also comply with MCP format return { content: [{ type: 'text' as const, text: `Execution failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • src/index.ts:29-29 (registration)
    Invocation of the specWorkflowTool.register method to register the tool with the main MCP server instance.
    specWorkflowTool.register(server);
  • Core helper function that dispatches workflow actions to specialized functions (initWorkflow, checkWorkflow, skipStage, confirmStage, completeTask) or returns current status.
    export async function executeWorkflow( args: WorkflowArgs, onProgress?: (progress: number, total: number, message: string) => Promise<void> ): Promise<WorkflowResult> { const { path, action } = args; if (!action) { return getStatus(path); } switch (action.type) { case 'init': if (!action.featureName || !action.introduction) { return { displayText: '❌ Initialization requires featureName and introduction parameters', data: { success: false, error: 'Missing required parameters' } }; } return initWorkflow({ path, featureName: action.featureName, introduction: action.introduction, onProgress }); case 'check': return checkWorkflow({ path, onProgress }); case 'skip': return skipStage({ path }); case 'confirm': return confirmStage({ path }); case 'complete_task': if (!action.taskNumber) { return { displayText: '❌ Completing task requires taskNumber parameter', data: { success: false, error: 'Missing required parameters' } }; } return completeTask({ path, taskNumber: action.taskNumber }); default: return { displayText: `❌ Unknown operation type: ${action.type}`, data: { success: false, error: `Unknown operation type: ${action.type}` } }; } }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kingkongshot/specs-workflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server