test_workflow
Start a structured workflow to write or improve test coverage. Provide a task description and optionally specify target files, test type, framework, and coverage goals.
Instructions
Start a focused workflow for writing or improving test coverage
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Description of what to test or test coverage to add | |
| context | No | Additional context (optional) |
Implementation Reference
- src/tools/testWorkflow.ts:47-59 (handler)The handler function that executes the test_workflow logic. It receives params (task and optional context) and a sessionManager, then delegates to executeWorkflow with workflowType set to 'test'.
export async function handleTestWorkflow( params: { task: string; context?: any }, sessionManager: SessionManager ) { return executeWorkflow( { task: params.task, workflowType: 'test', context: params.context }, sessionManager ); } - src/tools/testWorkflow.ts:5-44 (registration)Creates the tool definition object with name 'test_workflow', description, and inputSchema. The schema requires 'task' (string) and optionally accepts 'context' object with targetFiles, testType (unit/integration/e2e/all), testFramework, and coverageGoals.
export function createTestWorkflowTool(): Tool { return { name: 'test_workflow', description: 'Start a focused workflow for writing or improving test coverage', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'Description of what to test or test coverage to add' }, context: { type: 'object', description: 'Additional context (optional)', properties: { targetFiles: { type: 'array', items: { type: 'string' }, description: 'Files that need test coverage' }, testType: { type: 'string', enum: ['unit', 'integration', 'e2e', 'all'], description: 'Type of tests to write' }, testFramework: { type: 'string', description: 'Testing framework being used (e.g., jest, mocha, pytest)' }, coverageGoals: { type: 'array', items: { type: 'string' }, description: 'Specific coverage goals or scenarios to test' } } } }, required: ['task'] } }; - src/index.ts:242-248 (registration)The case statement in the main server that routes 'test_workflow' calls to handleTestWorkflow. This is where incoming MCP requests for this tool are dispatched.
case 'test_workflow': return { content: [{ type: 'text', text: JSON.stringify(await handleTestWorkflow(args as any, sessionManager), null, 2) }] }; - src/index.ts:141-142 (registration)Registration of createTestWorkflowTool() in the tools array so the tool definition is listed when clients request the available tools.
createTestWorkflowTool(), // Test writing workflow createTddWorkflowTool(), // TDD workflow - Documentation in the discover_workflow_tools response that describes the test_workflow tool to users, including its purpose, when to use it, and an example invocation.
{ name: 'test_workflow', purpose: 'Focused workflow for writing or improving tests', whenToUse: 'Adding test coverage, writing integration tests, test improvements', example: 'test_workflow({ task: "Add unit tests for payment processing" })',