Skip to main content
Glama
crazyrabbitLTC

Vibe-Coder MCP Server

update_task_status

Update the completion status of a specific task within a phased feature implementation workflow to track development progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
featureIdYes
phaseIdYes
taskIdYes
completedYes

Implementation Reference

  • The primary handler function that executes the logic for the 'update_task_status' tool. It parses input parameters using the schema, validates the feature/phase/task existence, calls the updateTaskStatus helper to persist the change, and returns appropriate feedback messages including suggestions for phase advancement.
    const updateTaskStatusHandler: ToolHandler<z.infer<typeof UpdateTaskStatusSchema>> = async (params) => {
      try {
        const { featureId, phaseId, taskId, completed } = UpdateTaskStatusSchema.parse(params);
        
        // Validate feature, phase and task
        const validationResult = validateFeaturePhaseTask(featureId, phaseId, taskId);
        if (!validationResult.valid) {
          return createToolErrorResponse(validationResult.message);
        }
        
        const { feature, phase, task } = validationResult.data;
        
        // Update the task status
        const updatedTask = updateTaskStatus(featureId, phaseId, taskId, completed);
        
        // Check if all tasks in this phase are now completed
        if (completed && phase.tasks.every((t: Task) => t.id === taskId || t.completed)) {
          // Auto-advance the phase to 'completed' status
          return {
            content: [{
              type: "text",
              text: `Task marked as ${completed ? 'completed' : 'incomplete'}. All tasks in this phase are now complete. The phase "${phase.name}" has been automatically marked as completed.`
            }]
          };
        }
        
        // Check if all tasks are completed and suggest phase update if applicable
        let message = `Task status updated to ${completed ? 'completed' : 'not completed'}`;
        
        if (completed && phase.tasks.every((t: Task) => t.id === taskId || t.completed)) {
          // All tasks are now completed
          message += `. All tasks in phase ${phase.name} are now completed. Consider updating the phase status to 'completed'.`;
        }
        
        return {
          content: [{
            type: "text",
            text: message
          }]
        };
      } 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 the input parameters for the update_task_status tool: featureId, phaseId, taskId, and completed boolean.
    const UpdateTaskStatusSchema = z.object({
      featureId: z.string().min(1),
      phaseId: z.string().min(1),
      taskId: z.string().min(1),
      completed: z.boolean()
    });
  • Registration of the 'update_task_status' tool with the toolRegistry, including the handler, description, JSON schema for inputs, and example calls.
      'update_task_status', 
      updateTaskStatusHandler,
      'Update the completion status of a task',
      {
        type: 'object',
        properties: {
          featureId: {
            type: 'string',
            description: 'ID of the feature containing the phase'
          },
          phaseId: {
            type: 'string',
            description: 'ID of the phase containing the task'
          },
          taskId: {
            type: 'string',
            description: 'ID of the task to update'
          },
          completed: {
            type: 'boolean',
            description: 'Whether the task is completed'
          }
        },
        required: ['featureId', 'phaseId', 'taskId', 'completed']
      },
      [
        {
          featureId: "feature-123",
          phaseId: "phase-456",
          taskId: "task-789",
          completed: true
        },
        {
          featureId: "feature-123",
          phaseId: "phase-456",
          taskId: "task-789",
          completed: false
        }
      ]
    );
  • Helper function that performs the actual update of a task's completed status within the feature's phase data structure and persists the change via updateFeature.
    export function updateTaskStatus(
      featureId: string,
      phaseId: string,
      taskId: string,
      completed: boolean
    ): Feature | undefined {
      const feature = getFeature(featureId);
      if (!feature) return undefined;
      
      const phaseIndex = feature.phases.findIndex(p => p.id === phaseId);
      if (phaseIndex === -1) return undefined;
      
      const taskIndex = feature.phases[phaseIndex].tasks.findIndex(t => t.id === taskId);
      if (taskIndex === -1) return undefined;
      
      const updatedPhases = [...feature.phases];
      const updatedTasks = [...updatedPhases[phaseIndex].tasks];
      
      updatedTasks[taskIndex] = {
        ...updatedTasks[taskIndex],
        completed,
        updatedAt: now()
      };
      
      updatedPhases[phaseIndex] = {
        ...updatedPhases[phaseIndex],
        tasks: updatedTasks,
        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