Skip to main content
Glama

get_plan_summary

Retrieve a comprehensive summary with statistics for a specific plan, enabling AI agents to analyze project details and track progress efficiently.

Instructions

Get a comprehensive summary with statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
plan_idYesPlan ID

Implementation Reference

  • Main handler for the 'get_plan_summary' tool. Fetches the plan details and all nodes, computes comprehensive statistics using calculatePlanStatistics, and returns a formatted summary with progress percentage.
    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 }); }
  • src/tools.js:417-427 (registration)
    Tool registration in the ListToolsRequest handler, including 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"] } }
  • Helper function to compute detailed statistics for a plan's nodes, recursively processing the hierarchy to count types, statuses, and list in-progress/blocked nodes. Called by the handler.
    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