test_workflow
Create and enhance test coverage by defining tasks, target files, test types, and frameworks using structured workflows for reliable and auditable results.
Instructions
Start a focused workflow for writing or improving test coverage
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Additional context (optional) | |
| task | Yes | Description of what to test or test coverage to add |
Implementation Reference
- src/tools/testWorkflow.ts:47-59 (handler)Main execution logic for the test_workflow tool: delegates to executeWorkflow with workflowType '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:9-43 (schema)Input schema defining parameters for test_workflow: requires 'task', optional 'context' with test details.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:137-157 (registration)Tool registration: createTestWorkflowTool() is included in the tools array provided to the MCP server at line 141.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 ];
- src/index.ts:15-15 (registration)Import of test_workflow tool factory and handler from testWorkflow.ts.import { createTestWorkflowTool, handleTestWorkflow } from './tools/testWorkflow.js';
- src/index.ts:242-248 (handler)Main server request handler dispatch: routes 'test_workflow' calls to the specific handleTestWorkflow function.case 'test_workflow': return { content: [{ type: 'text', text: JSON.stringify(await handleTestWorkflow(args as any, sessionManager), null, 2) }] };