Skip to main content
Glama

explain_issue

Explains code quality issues detected during review, providing detailed analysis, category context, and actionable fix guidance for developers to resolve problems.

Instructions

Explain a code quality issue detected by OCR. Returns detailed explanation, category context, and fix guidance for the AI agent to act on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueYesThe issue description to explain
fileNoFile path where the issue was found
lineNoLine number
severityNoSeverity: critical/high/medium/low/info
categoryNoIssue category
suggestionNoAuto-generated fix suggestion

Implementation Reference

  • The handler function that processes issue explanations for the explain_issue tool.
    export async function handleExplainIssue(args: z.infer<typeof explainIssueSchema>) {
      const categoryExplanation = args.category ? CATEGORY_EXPLANATIONS[args.category] : null;
    
      const explanation = {
        issue: args.issue,
        file: args.file ?? null,
        line: args.line ?? null,
        severity: args.severity ?? null,
        category: args.category ?? null,
        suggestion: args.suggestion ?? null,
        categoryExplanation,
        analysis: `This is a ${args.severity ?? "unknown"} severity issue in the "${args.category ?? "uncategorized"}" category. ${categoryExplanation ?? "Review the flagged code and consider the suggestion for resolution."}`,
      };
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(explanation, null, 2),
          },
        ],
      };
    }
  • Zod schema defining the input arguments for the explain_issue tool.
    export const explainIssueSchema = z.object({
      issue: z.string().describe("The issue description to explain"),
      file: z.string().optional().describe("File path where the issue was found"),
      line: z.number().optional().describe("Line number where the issue was found"),
      severity: z.string().optional().describe("Issue severity (critical/high/medium/low/info)"),
      category: z.string().optional().describe("Issue category"),
      suggestion: z.string().optional().describe("Auto-generated fix suggestion"),
    });

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/raye-deng/open-code-review'

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