Skip to main content
Glama

Explain a code change

explain_change

Document every meaningful code edit with intent, rationale, trade-offs, and verification to preserve developer understanding and maintainability during AI-assisted development.

Instructions

Record an explanation for a change you just made. Call this after every meaningful code edit — before moving on to the next task. The explanation is quality-checked and rejected if it does not genuinely transfer understanding. "I fixed a bug" or "refactored for clarity" will be rejected. You need a session open (call start_session first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesEvery file changed, with per-file what/why.
scaleYestrivial: whitespace, rename, one-liner. local: one function/class, no external contracts changed. structural: module boundaries or data shapes changed, callers affected. architectural: cross-cutting concerns, deployment topology, system contracts.
intentYesThe user-facing goal this change serves, in the user's own framing. Not your framing.
diagramNoOptional Mermaid source code that illustrates the change.
summaryYesOne-line summary. Reads like a good git commit subject.
rejectedYesApproaches you considered and did not take. Empty is valid for trivial/local changes; structural+ changes must have at least one.
callChainNoCall graph nodes for this change. Include modified/created nodes and their direct callers. Required for structural and architectural changes to visualize impact.
followUpsYesWork this change implies but does not do.
rationaleYesThe reasoning: WHY this shape of solution. State the constraint, failure mode, or alternative it beats. Do NOT restate what you changed — that is what summary and files are for.
sessionIdYesThe session id returned by start_session.
tradeoffsYesCosts knowingly accepted: what got slower, more complex, or harder to change. An honest empty array is fine for trivial changes.
confidenceYesverified: you ran something (build, test, manual check) and it passed — list it in verification. likely: you reasoned it through but did not run it. unverified: you are unsure.
verificationYesHow a reviewer can check this: commands run, test names, manual steps. Required when confidence is "verified".
conventionsAppliedYesConvention ids checked against while making this change. Pass [] if no conventions exist yet.
implementationFlowNoOptional step-by-step, method-level breakdown showing how this feature runs end-to-end. Format each step as: "MethodName(args) — what it does and why it matters". Example: "POST /login → validateInput(email, password) — checks format, rejects injection → UserRepo.findByEmail(email) — queries DB, returns record or null → bcrypt.compare(input, hash) — constant-time comparison, prevents timing attacks → SessionService.create(userId) — generates token, writes to Redis → 200 {token, expiresAt}". For structural/architectural changes, include an `implementationFlow` field with a step-by-step method-level breakdown showing how the feature works end-to-end.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that explanations are 'quality-checked and rejected if they do not genuinely transfer understanding,' including specific rejection examples. It also discloses the session requirement, adding valuable context beyond what the schema shows. There is no mention of side effects or return values, but the key behavior is covered.

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

Conciseness5/5

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

The description is four sentences with no wasted words. It front-loads the purpose, then provides usage timing, quality expectations, and a prerequisite. Each sentence earns its place, and the structure is clear and efficient.

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?

The tool has a complex schema (15 params, 12 required) which is fully documented. The description adds workflow context: when to call, quality bar, and session prerequisite. Since there is no output schema, it could explain return values, but the description adequately covers what a caller needs to know to use the tool correctly, given the schema richness.

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?

The schema has 100% parameter description coverage with detailed descriptions for all 15 parameters, so the baseline is 3. The description adds general quality guidance (e.g., 'I fixed a bug' will be rejected) that informs fields like summary and rationale, but it does not provide parameter-specific semantics beyond what the schema already offers.

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 clearly states the tool's purpose with a specific verb and resource: 'Record an explanation for a change you just made.' It also distinguishes from siblings by emphasizing recording after edits, which contrasts with recall/list tools. The title 'Explain a code change' aligns with the description.

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?

The description explicitly says when to use the tool: 'Call this after every meaningful code edit — before moving on to the next task.' It also provides a prerequisite: 'You need a session open (call start_session first).' However, it does not mention alternatives or when-not-to-use scenarios, so it falls short of a 5.

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/akay1121/DiffMind'

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