Skip to main content
Glama
crazyrabbitLTC

Vibe-Coder MCP Server

update_phase_status

Update the status of a development phase for a specific feature to track progress through pending, in-progress, completed, or reviewed stages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureIdYes
phaseIdYes
statusYes

Implementation Reference

  • The main tool handler function that validates input, checks feature/phase existence, validates transition, calls the update function, and returns success message.
    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");
      }
    };
  • Zod schema defining input parameters: featureId, phaseId, and status (enum).
    const UpdatePhaseStatusSchema = z.object({
      featureId: z.string().min(1),
      phaseId: z.string().min(1),
      status: z.enum(["pending", "in_progress", "completed", "reviewed"])
    });
  • Registers the tool with the registry, including name, handler, description, JSON schema, and example arguments.
    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"
        }
      ]
    );
  • Core function that performs the phase status update: finds phase, validates transition using validatePhaseTransition, updates the phase status and timestamp, persists via updateFeature.
    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 });
    }

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/crazyrabbitLTC/mcp-vibecoder'

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