Skip to main content
Glama

openspec_get_review_summary

Retrieve a summary of reviews for a change, covering all files in the change request.

Instructions

Get review summary for a change (all files)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
changeIdYesChange ID

Implementation Reference

  • Handler function for 'openspec_get_review_summary' tool. Calls reviewManager.getChangeReviews() to fetch reviews across proposal, design, and tasks files, then formats a text summary including overall counts, per-file breakdown, per-type breakdown, and a warning about blocking issues.
    server.registerTool(
      'openspec_get_review_summary',
      {
        description: 'Get review summary for a change (all files)',
        inputSchema: {
          changeId: z.string().describe('Change ID'),
        },
      },
      async ({ changeId }) => {
        const { proposal, design, tasks, summary } = await reviewManager.getChangeReviews(changeId);
    
        let text = `Review Summary for: ${changeId}\n`;
        text += `${'='.repeat(40)}\n\n`;
    
        text += `📊 Overall: ${summary.total} reviews\n`;
        text += `   🔴 Open: ${summary.open}\n`;
        text += `   ✅ Resolved: ${summary.resolved}\n`;
        text += `   â­ī¸ Won't Fix: ${summary.wontFix}\n\n`;
    
        text += `📁 By File:\n`;
        text += `   proposal.md: ${proposal.length}\n`;
        text += `   design.md: ${design.length}\n`;
        text += `   tasks.md: ${tasks.length}\n\n`;
    
        text += `📋 By Type:\n`;
        text += `   đŸ’Ŧ Comments: ${summary.byType.comment}\n`;
        text += `   💡 Suggestions: ${summary.byType.suggestion}\n`;
        text += `   ❓ Questions: ${summary.byType.question}\n`;
        text += `   🚨 Issues: ${summary.byType.issue}\n\n`;
    
        if (summary.hasBlockingIssues) {
          text += `âš ī¸ Blocking issues exist! Cannot request approval.\n`;
        }
    
        return { content: [{ type: 'text', text }] };
      }
    );
  • Type definition for ReviewSummary used as the return type for getChangeReviews(). Contains total/open/resolved/wontFix counts, byType and bySeverity breakdowns, and a hasBlockingIssues flag.
    export interface ReviewSummary {
      total: number;
      open: number;
      resolved: number;
      wontFix: number;
      byType: Record<ReviewType, number>;
      bySeverity: Record<ReviewSeverity, number>;
      hasBlockingIssues: boolean;
    }
  • Helper method getChangeReviews() on the ReviewManager class. Loads all reviews for a changeId across proposal, design, and tasks files, computes summary statistics (total, open, resolved, wontFix, byType, bySeverity, hasBlockingIssues) and returns them alongside the grouped review arrays.
    async getChangeReviews(changeId: string): Promise<{
      proposal: ReviewComment[];
      design: ReviewComment[];
      tasks: ReviewComment[];
      summary: ReviewSummary;
    }> {
      const proposal = await this.loadReviews('proposal', changeId);
      const design = await this.loadReviews('design', changeId);
      const tasks = await this.loadReviews('tasks', changeId);
      
      const allReviews = [...proposal, ...design, ...tasks];
      
      // čŽĄįŽ—æ€ģäŊ“įģŸčŽĄ
      const summary: ReviewSummary = {
        total: allReviews.length,
        open: allReviews.filter((r) => r.status === 'open').length,
        resolved: allReviews.filter((r) => r.status === 'resolved').length,
        wontFix: allReviews.filter((r) => r.status === 'wont_fix').length,
        byType: { comment: 0, suggestion: 0, question: 0, issue: 0 },
        bySeverity: { low: 0, medium: 0, high: 0 },
        hasBlockingIssues: false,
      };
    
      for (const review of allReviews) {
        summary.byType[review.type]++;
        if (review.severity) summary.bySeverity[review.severity]++;
        if (review.status === 'open' && review.type === 'issue' && review.severity === 'high') {
          summary.hasBlockingIssues = true;
        }
      }
    
      return { proposal, design, tasks, summary };
    }
  • Registration entry point for all review tools including 'openspec_get_review_summary'. The function is called with an McpServer instance and ReviewManager, then registers the tool via server.registerTool().
    export function registerReviewTools(server: McpServer, reviewManager: ReviewManager): void {
Behavior2/5

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

No annotations are present, so the description carries full burden. It only states the action without disclosing whether it's read-only, any side effects, authorization needs, or what 'summary' entails.

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

Conciseness4/5

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

The description is a single concise sentence with no wasted words. It could benefit from more structure, but it is efficient.

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 single-parameter tool with no output schema and no annotations, the description lacks context on output format, behavior, and how it compares to related tools. It is insufficient for an agent to fully understand the tool.

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

Parameters3/5

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

Schema coverage is 100% and the description does not add meaning beyond 'Change ID'. Baseline score of 3 applies since the schema documents the parameter adequately.

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

Purpose5/5

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

The description 'Get review summary for a change (all files)' uses a specific verb (get) and resource (review summary), clearly indicating what the tool does and distinguishes it from siblings like openspec_list_reviews and openspec_show_change.

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?

No guidance is provided on when to use this tool versus alternatives (e.g., openspec_get_approval_status, openspec_get_critique_result). There are no conditions for use or exclusions.

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/Lumiaqian/openspec-mcp'

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