Skip to main content
Glama

add_explanations

Adds explanations for added or removed code blocks, describing what each does and how it works for reviewers.

Instructions

Explain blocks of added or removed code to the reviewer, as a batch: what each block does and how it works. Write one for every long (about 30 lines or more) or complex block; skip trivial code. An explanation judges nothing: problems go in findings. Each location is checked against the frozen diff and its lines are copied; if any explanation is invalid, nothing is added and every problem is reported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
analysis_idYesId of the analysis, as returned by create_analysis or list_analyses.
explanationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.13

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses batch/atomic semantics ('if any explanation is invalid, nothing is added and every problem is reported'), validation against a frozen diff, and line-copying behavior. It is missing only surrounding operational context such as permission or auth requirements.

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?

Four compact sentences, front-loaded with the core action and scope, then guidance, then failure behavior. It is dense but every sentence carries usable information; the single long paragraph is only mildly heavy.

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

Completeness4/5

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

With no annotations and no output schema, the description covers purpose, inclusion criteria, output effect (lines copied onto the diff), and atomic failure behavior, which is enough for correct invocation. Return-value details are unnecessary given no output schema, leaving only minor gaps like auth context.

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

Parameters4/5

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

Top-level coverage is 50%, but the nested item schema documents body, path, side, title, and line fields in detail. The description still adds semantics the schema does not spell out — that locations are checked against the frozen diff and their lines copied — which explains why exact path/line/side values matter.

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 gives a specific verb and resource ('Explain blocks of added or removed code to the reviewer, as a batch') and immediately clarifies scope by contrasting with the sibling concept of findings ('problems go in findings'). An agent can tell this apart from add_findings without opening either schema.

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

Usage Guidelines4/5

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

It states when to create one ('every long (about 30 lines or more) or complex block') and when not to ('skip trivial code'), plus routing away from findings. It stops short of naming the update/delete siblings (update_explanation, delete_explanations) as alternatives for existing explanations.

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