Skip to main content
Glama
rodhayl
by rodhayl

mcp_diff_summarizer

Summarize code diffs into concise human-readable changes for easier code review and understanding of modifications.

Instructions

Summarize code diffs into concise human-readable changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffYesGit diff or unified diff content
formatNoOutput format (default: summary)

Implementation Reference

  • Implementation of the `explainDiff` method in `CodeAssistanceTools` class, which uses the `mcp_diff_summarizer` identifier for the tool call logic.
      /**
       * Explain code diff in plain language
       */
      async explainDiff(
        diff: string,
        options?: {
          context?: string;
        }
      ): Promise<ExplainDiffResult> {
        const prompt = `You are an expert at explaining code changes. Analyze this diff and explain what changed in plain English.
    ${options?.context ? `Context: ${options.context}` : ''}
    
    Provide your response as JSON:
    {
      "summary": "High-level summary of changes",
      "changes": [
        {
          "type": "added|removed|modified",
          "description": "What was changed",
          "impact": "Why this change matters"
        }
      ],
      "risks": ["Any potential risks or concerns"]
    }`;
    
        try {
          const responseText = await this.llmWrapper.callToolLlm(
            'mcp_diff_summarizer',
            [
              { role: 'system', content: prompt },
              { role: 'user', content: diff },
            ],
            { type: 'explain_diff' }
          );
    
          const parsed = this.parseJsonResponse(responseText, {
            summary: responseText,
            changes: [],
          });
    
          return {
            success: true,
            summary: parsed.summary || '',
            changes: parsed.changes || [],
            risks: parsed.risks,
          };
        } catch (error) {
          return {
            success: false,
            summary: '',
            changes: [],
            error: error instanceof Error ? error.message : 'Unknown error',
          };
        }
      }

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/rodhayl/mcpLocalHelper'

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