Skip to main content
Glama

get_milestone_metrics

Retrieve progress metrics for GitHub project milestones to track completion status and analyze issue data.

Instructions

Get progress metrics for a specific milestone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
milestoneIdYes
includeIssuesYes

Implementation Reference

  • Core handler implementation: Fetches milestone data, retrieves all issues assigned to it, calculates open/closed counts, completion percentage, overdue status, and days remaining. Optionally includes issue details.
    async getMilestoneMetrics(id: string, includeIssues: boolean = false): Promise<MilestoneMetrics> {
      try {
        const milestone = await this.milestoneRepo.findById(id);
        if (!milestone) {
          throw new ResourceNotFoundError(ResourceType.MILESTONE, id);
        }
    
        const allIssues = await this.issueRepo.findAll();
        const issues = allIssues.filter(issue => issue.milestoneId === milestone.id);
    
        const totalIssues = issues.length;
        const closedIssues = issues.filter(
          issue => issue.status === ResourceStatus.CLOSED || issue.status === ResourceStatus.COMPLETED
        ).length;
        const openIssues = totalIssues - closedIssues;
        const completionPercentage = totalIssues > 0 ? Math.round((closedIssues / totalIssues) * 100) : 0;
    
        const now = new Date();
        let isOverdue = false;
        let daysRemaining: number | undefined = undefined;
    
        if (milestone.dueDate) {
          const dueDate = new Date(milestone.dueDate);
          isOverdue = now > dueDate;
          daysRemaining = Math.ceil((dueDate.getTime() - now.getTime()) / (1000 * 60 * 60 * 24));
        }
    
        return {
          id: milestone.id,
          title: milestone.title,
          dueDate: milestone.dueDate,
          openIssues,
          closedIssues,
          totalIssues,
          completionPercentage,
          status: milestone.status,
          issues: includeIssues ? issues : undefined,
          isOverdue,
          daysRemaining: daysRemaining && daysRemaining > 0 ? daysRemaining : undefined
        };
      } catch (error) {
        throw this.mapErrorToMCPError(error);
      }
    }
  • Zod schema definition for tool input validation: requires milestoneId (string) and includeIssues (boolean).
    // Schema for get_milestone_metrics tool
    export const getMilestoneMetricsSchema = z.object({
      milestoneId: z.string().min(1, "Milestone ID is required"),
      includeIssues: z.boolean(),
    });
    
    export type GetMilestoneMetricsArgs = z.infer<typeof getMilestoneMetricsSchema>;
  • ToolDefinition object defining the tool name, description, schema reference, and usage examples.
    export const getMilestoneMetricsTool: ToolDefinition<GetMilestoneMetricsArgs> = {
      name: "get_milestone_metrics",
      description: "Get progress metrics for a specific milestone",
      schema: getMilestoneMetricsSchema as unknown as ToolSchema<GetMilestoneMetricsArgs>,
      examples: [
        {
          name: "Get milestone progress",
          description: "Get progress metrics for milestone #2",
          args: {
            milestoneId: "2",
            includeIssues: true,
          },
        },
      ],
    };
  • Registers the getMilestoneMetricsTool in the central ToolRegistry singleton during initialization.
    this.registerTool(getMilestoneMetricsTool);
  • MCP tool dispatcher: Handles call_tool requests for get_milestone_metrics by delegating to ProjectManagementService.getMilestoneMetrics.
    case "get_milestone_metrics":
      return await this.service.getMilestoneMetrics(args.milestoneId, args.includeIssues);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' metrics (implying read-only), but doesn't specify what 'progress metrics' includes (e.g., completion percentage, issue counts, timelines), whether it requires specific permissions, or how it handles errors. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple retrieval tool. Every word earns its place by specifying what's being retrieved and for what resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 required parameters, 0% schema description coverage, no annotations, and no output schema, the description is insufficient. It doesn't explain what metrics are returned, what 'includeIssues' controls, or provide any behavioral context. The agent would struggle to use this effectively without additional documentation or trial-and-error.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description mentions 'specific milestone' which hints at 'milestoneId', but doesn't explain what 'includeIssues' does or why it's required. It adds minimal semantic value beyond what can be inferred from parameter names, failing to compensate for the complete lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'progress metrics for a specific milestone', making the purpose unambiguous. It distinguishes from siblings like 'get_milestones' (list) and 'get_sprint_metrics' (different resource), though it doesn't explicitly name these alternatives. The specificity of 'progress metrics' provides good differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_milestones' (which might list milestones without metrics) or 'get_sprint_metrics' (for sprint-level metrics). There's no mention of prerequisites, context, or exclusion criteria. The agent must infer usage from the name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/HarshKumarSharma/MCP'

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