update_phase_status
Update the status of development phases in the workflow by specifying feature ID, phase ID, and status. Supports pending, in progress, completed, and reviewed states for progress tracking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| featureId | Yes | ||
| phaseId | Yes | ||
| status | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"featureId": {
"minLength": 1,
"type": "string"
},
"phaseId": {
"minLength": 1,
"type": "string"
},
"status": {
"enum": [
"pending",
"in_progress",
"completed",
"reviewed"
],
"type": "string"
}
},
"required": [
"featureId",
"phaseId",
"status"
],
"type": "object"
}
Implementation Reference
- src/tool-handlers.ts:302-336 (handler)The MCP tool handler for 'update_phase_status'. Parses input using Zod schema, validates feature/phase, calls the core updatePhaseStatus function, and returns success message or error.const updatePhaseStatusHandler: ToolHandler<z.infer<typeof UpdatePhaseStatusSchema>> = async (params) => { try { const { featureId, phaseId, status } = UpdatePhaseStatusSchema.parse(params); // Validate feature and phase const validationResult = validateFeaturePhaseTask(featureId, phaseId); if (!validationResult.valid) { return createToolErrorResponse(validationResult.message); } const { feature, phase } = validationResult.data; // Validate the status transition const transitionResult = phase.status !== status; if (!transitionResult) { return invalidPhaseTransitionError(phase.status, status); } // Update the phase status const updatedPhase = updatePhaseStatus(featureId, phaseId, status); return { content: [{ type: "text", text: `Phase status updated to "${status}"` }] }; } catch (error) { if (error instanceof z.ZodError) { const errorMessage = error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '); return createToolErrorResponse(`Validation error: ${errorMessage}`); } return createToolErrorResponse(error instanceof Error ? error.message : "Unknown error"); } };
- src/tool-handlers.ts:293-297 (schema)Zod schema defining input parameters for the update_phase_status tool: featureId, phaseId, and status.const UpdatePhaseStatusSchema = z.object({ featureId: z.string().min(1), phaseId: z.string().min(1), status: z.enum(["pending", "in_progress", "completed", "reviewed"]) });
- src/tool-handlers.ts:647-681 (registration)Registration of the 'update_phase_status' tool with the toolRegistry, including JSON schema and examples.toolRegistry.register( 'update_phase_status', updatePhaseStatusHandler, 'Update the status of a development phase', { type: 'object', properties: { featureId: { type: 'string', description: 'ID of the feature containing the phase' }, phaseId: { type: 'string', description: 'ID of the phase to update' }, status: { type: 'string', description: 'New status for the phase (pending, in_progress, completed, reviewed)' } }, required: ['featureId', 'phaseId', 'status'] }, [ { featureId: "feature-123", phaseId: "phase-456", status: "in_progress" }, { featureId: "feature-123", phaseId: "phase-456", status: "completed" } ] );
- src/phases.ts:119-146 (helper)Core helper function that performs the actual phase status update: finds phase, validates transition, updates feature storage.export function updatePhaseStatus( featureId: string, phaseId: string, status: PhaseStatus ): Feature | undefined { const feature = getFeature(featureId); if (!feature) return undefined; const phaseIndex = feature.phases.findIndex(p => p.id === phaseId); if (phaseIndex === -1) return undefined; // Validate the status transition const phase = feature.phases[phaseIndex]; const validationResult = validatePhaseTransition(phase.status, status); if (!validationResult.valid) { console.error(validationResult.message); return undefined; } const updatedPhases = [...feature.phases]; updatedPhases[phaseIndex] = { ...updatedPhases[phaseIndex], status, updatedAt: now() }; return updateFeature(featureId, { phases: updatedPhases }); }