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
| Name | Required | Description | Default |
|---|---|---|---|
| issue | Yes | The issue description to explain | |
| file | No | File path where the issue was found | |
| line | No | Line number | |
| severity | No | Severity: critical/high/medium/low/info | |
| category | No | Issue category | |
| suggestion | No | Auto-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"), });