Skip to main content
Glama

getPlanStatus

Retrieve comprehensive plan overview including metadata, progress tracking, and task status statistics from the MCPlanManager task management system.

Instructions

获取整个计划的全面概览,包括元数据、进度、任务状态统计等。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'getPlanStatus' MCP tool. It is decorated with @mcp.tool() which registers it, and delegates execution to the PlanManager instance.
    @mcp.tool()
    def getPlanStatus() -> ToolResponse[PlanStatusData]:
        """获取整个计划的全面概览,包括元数据、进度、任务状态统计等。"""
        return plan_manager.getPlanStatus()
  • Core implementation of getPlanStatus in PlanManager class, computing plan progress, task counts, and status summary.
    def getPlanStatus(self) -> Dict:
        """获取计划状态"""
        total_tasks = len(self.plan_data["tasks"])
        if total_tasks == 0:
            return {
                "success": True, 
                "data": {
                    "meta": self.plan_data["meta"],
                    "state": self.plan_data["state"],
                    "progress": {"completed_tasks": 0, "total_tasks": 0, "progress_percentage": 0.0},
                    "task_counts": {"pending": 0, "in_progress": 0, "completed": 0, "failed": 0, "skipped": 0, "total": 0}
                }
            }
    
        completed_count = sum(1 for task in self.plan_data["tasks"] if task["status"] in ["completed", "skipped"])
        progress_percentage = (completed_count / total_tasks) * 100 if total_tasks > 0 else 0
        
        task_counts = {}
        for task in self.plan_data["tasks"]:
            status = task["status"]
            task_counts[status] = task_counts.get(status, 0) + 1
    
        status_data = {
            "meta": self.plan_data["meta"],
            "state": self.plan_data["state"],
            "progress": {
                "completed_tasks": completed_count,
                "total_tasks": total_tasks,
                "progress_percentage": round(progress_percentage, 2)
            },
            "task_counts": {
                "pending": task_counts.get("pending", 0),
                "in_progress": task_counts.get("in_progress", 0),
                "completed": task_counts.get("completed", 0),
                "failed": task_counts.get("failed", 0),
                "skipped": task_counts.get("skipped", 0),
                "total": total_tasks
            }
        }
        return {"success": True, "data": status_data}
  • Pydantic schema definitions for PlanStatusData and its submodels, used in the return type of getPlanStatus tool.
    class PlanStatusMeta(BaseModel):
        goal: str
        created_at: str
        updated_at: str
    
    class PlanStatusState(BaseModel):
        current_task_id: Optional[int]
        status: str
    
    class PlanProgress(BaseModel):
        completed_tasks: int
        total_tasks: int
        progress_percentage: float
    
    class PlanTaskCounts(BaseModel):
        pending: int
        in_progress: int
        completed: int
        failed: int
        skipped: int
        total: int
    
    class PlanStatusData(BaseModel):
        """
        用于getPlanStatus工具,定义其返回数据的详细模型。
        """
        meta: PlanStatusMeta
        state: PlanStatusState
        progress: PlanProgress
        task_counts: PlanTaskCounts 

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/donway19/MCPlanManager'

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