Skip to main content
Glama
TAgents

Planning System MCP Server

by TAgents

get_plan_summary

Retrieve a comprehensive summary with statistics for a specific plan using its ID to understand project status and metrics.

Instructions

Get a comprehensive summary with statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYesPlan ID

Implementation Reference

  • src/tools.js:417-427 (registration)
    Registers the get_plan_summary tool in the list of available tools, including its name, description, and input schema.
    {
      name: "get_plan_summary",
      description: "Get a comprehensive summary with statistics",
      inputSchema: {
        type: "object",
        properties: {
          plan_id: { type: "string", description: "Plan ID" }
        },
        required: ["plan_id"]
      }
    }
  • The main execution handler for the get_plan_summary tool. Fetches the plan and its nodes via apiClient, computes statistics using the calculatePlanStatistics helper, calculates progress percentage, and returns a formatted response.
    if (name === "get_plan_summary") {
      const { plan_id } = args;
      
      const plan = await apiClient.plans.getPlan(plan_id);
      const nodes = await apiClient.nodes.getNodes(plan_id);
      
      // Calculate statistics
      const stats = calculatePlanStatistics(nodes);
      
      return formatResponse({
        plan: {
          id: plan.id,
          title: plan.title,
          status: plan.status,
          description: plan.description,
          created_at: plan.created_at,
          updated_at: plan.updated_at
        },
        statistics: stats,
        progress_percentage: stats.total > 0 
          ? ((stats.status_counts.completed / stats.total) * 100).toFixed(1)
          : 0
      });
    }
  • Helper function specifically used by get_plan_summary to recursively traverse the plan's node hierarchy and compute comprehensive statistics including total nodes, counts by type and status, and lists of in-progress and blocked nodes.
    function calculatePlanStatistics(nodes) {
      const stats = {
        total: 0,
        type_counts: {
          root: 0,
          phase: 0,
          task: 0,
          milestone: 0
        },
        status_counts: {
          not_started: 0,
          in_progress: 0,
          completed: 0,
          blocked: 0
        },
        in_progress_nodes: [],
        blocked_nodes: []
      };
      
      const processNode = (node) => {
        stats.total++;
        
        if (node.node_type && stats.type_counts[node.node_type] !== undefined) {
          stats.type_counts[node.node_type]++;
        }
        
        if (node.status && stats.status_counts[node.status] !== undefined) {
          stats.status_counts[node.status]++;
          
          if (node.status === 'in_progress') {
            stats.in_progress_nodes.push({
              id: node.id,
              title: node.title,
              type: node.node_type
            });
          } else if (node.status === 'blocked') {
            stats.blocked_nodes.push({
              id: node.id,
              title: node.title,
              type: node.node_type
            });
          }
        }
        
        if (node.children && node.children.length > 0) {
          node.children.forEach(processNode);
        }
      };
      
      nodes.forEach(processNode);
      
      return stats;
    }

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/TAgents/agent-planner-mcp'

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