Skip to main content
Glama
kingdomseed

Structured Workflow MCP

by kingdomseed

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']
        }
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Start a Test-Driven Development workflow' but doesn't explain what this entails—e.g., whether it initiates a process, generates code, requires user interaction, or has side effects like file modifications. For a tool with no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. It uses clear terminology ('Test-Driven Development,' 'Red-Green-Refactor cycles') and avoids redundancy, making it easy to parse quickly. Every word earns its place, contributing directly to understanding the tool's intent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of initiating a TDD workflow and the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects (e.g., what the tool actually does operationally), expected outcomes, or error handling. With no output schema to explain return values, the description should provide more context to guide the agent effectively, but it falls short.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the schema already documents both parameters ('task' and 'context') and their sub-properties thoroughly. The description adds no additional meaning beyond what the schema provides, such as examples or usage tips. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Start a Test-Driven Development workflow with Red-Green-Refactor cycles.' It specifies the action ('Start'), the resource ('Test-Driven Development workflow'), and the methodology ('Red-Green-Refactor cycles'). However, it doesn't explicitly differentiate from sibling tools like 'test_workflow' or 'create_feature_workflow,' which might have overlapping purposes, preventing a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, compare it to sibling tools (e.g., 'test_workflow' or 'create_feature_workflow'), or specify scenarios where it's appropriate or inappropriate. This lack of contextual direction leaves the agent with minimal usage cues.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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