Skip to main content
Glama

tdd_workflow

Implement features using Test-Driven Development by following Red-Green-Refactor cycles to write tests before code and ensure quality through structured validation.

Instructions

Start a Test-Driven Development workflow with Red-Green-Refactor cycles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesDescription of the feature to develop using TDD
contextNoAdditional context (optional)

Implementation Reference

  • Core handler function for tdd_workflow tool. Delegates to executeWorkflow with 'tdd' workflowType.
    export async function handleTddWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'tdd', context: params.context }, sessionManager ); }
  • Input schema defining parameters for tdd_workflow tool including task (required) and optional context.
    inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of the feature to develop using TDD' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files where tests and implementation will be added' }, testFirst: { type: 'boolean', default: true, description: 'Always write the test first (TDD principle)' }, acceptanceCriteria: { type: 'array', items: { type: 'string' }, description: 'Clear acceptance criteria for the feature' }, testFramework: { type: 'string', description: 'Testing framework to use' } } } }, required: ['task'] }
  • src/index.ts:137-157 (registration)
    Registration of tdd_workflow tool via createTddWorkflowTool() in the server tools array used for ListToolsRequest.
    const tools = [ // Workflow entry points createRefactorWorkflowTool(), // Refactoring workflow createFeatureWorkflowTool(), // Feature creation workflow createTestWorkflowTool(), // Test writing workflow createTddWorkflowTool(), // TDD workflow createBuildCustomWorkflowTool(), // Custom workflow builder // Phase guidance tools ...createPhaseGuidanceTools(), // Handles both suggestive and directive modes createTestGuidanceTool(), // TEST phase guidance // Validation tools ...createValidationTools(), // Both validate_action and validate_phase_completion // Workflow management createUserInputRequiredTool(), // Escalation handling createWorkflowStatusTool(), // Workflow status createPhaseOutputTool(), // Phase output recording createDiscoverWorkflowToolsTool() // Tool discovery ];
  • Server-side dispatch handler for tdd_workflow tool calls in the MCP CallToolRequest handler switch statement.
    case 'tdd_workflow': return { content: [{ type: 'text', text: JSON.stringify(await handleTddWorkflow(args as any, sessionManager), null, 2) }] };
  • Tool factory function that creates and returns the Tool object spec for tdd_workflow, including name, description, and schema.
    export function createTddWorkflowTool(): Tool { return { name: 'tdd_workflow', description: 'Start a Test-Driven Development workflow with Red-Green-Refactor cycles', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of the feature to develop using TDD' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files where tests and implementation will be added' }, testFirst: { type: 'boolean', default: true, description: 'Always write the test first (TDD principle)' }, acceptanceCriteria: { type: 'array', items: { type: 'string' }, description: 'Clear acceptance criteria for the feature' }, testFramework: { type: 'string', description: 'Testing framework to use' } } } }, required: ['task'] } }; }

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/kingdomseed/structured-workflow-mcp'

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