Skip to main content
Glama

explain_code

Read-only

Why the code is the way it is: the history behind a path or symbol, oldest first — each edit (who, when, what changed), completed intents with their rationales, reverted attempts and anchored notes. It includes uncommitted work and the reasons given. Read-only.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "explain_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFile to explain; with no symbol, the whole file.
symbolNoNarrow the history to one symbol.
repo_idNoThe repository id, e.g. github.com/org/repo (the Cork briefing names it). Omit it to use the repo your session works in.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / repo_id / description
      Previous value: -"The repository id, e.g. github.com/org/repo (the Collide briefing names it). Omit it to use the repo your session works in."New value: +"The repository id, e.g. github.com/org/repo (the Cork briefing names it). Omit it to use the repo your session works in."
  2. Changed2 schema fields changed
    • changedInput schema / properties / repo_id / description
      Previous value: -"The repository id, e.g. github.com/org/repo (repo_id in .collide/config.json)."New value: +"The repository id, e.g. github.com/org/repo (the Collide briefing names it). Omit it to use the repo your session works in."
    • changedInput schema / required
      Previous value: -[
      -  "repo_id"
      -]New value: +[]
  3. Changed3 schema fields changed
    • addedInput schema / properties / path / description
      Added value: +"File to explain; with no symbol, the whole file."
    • addedInput schema / properties / repo_id / description
      Added value: +"The repository id, e.g. github.com/org/repo (repo_id in .collide/config.json)."
    • addedInput schema / properties / symbol / description
      Added value: +"Narrow the history to one symbol."
  4. Changed9 schema fields changed
    • removedInput schema / properties / path / default
      Removed value: -""
    • removedInput schema / properties / path / description
      Removed value: -"Repo-relative file path, e.g. src/app/api.py."
    • removedInput schema / properties / path / title
      Removed value: -"Path"
    • removedInput schema / properties / repo_id / description
      Removed value: -"Repository id — the git remote (e.g. github.com/acme/api) or a bare folder name; a #branch suffix scopes to that branch."
    • removedInput schema / properties / repo_id / title
      Removed value: -"Repo Id"
    • removedInput schema / properties / symbol / default
      Removed value: -""
    • removedInput schema / properties / symbol / description
      Removed value: -"A symbol in the file — function, class, method, or constant name."
    • removedInput schema / properties / symbol / title
      Removed value: -"Symbol"
    • removedInput schema / title
      Removed value: -"explain_codeArguments"
  5. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/destructiveHint=false, so the trailing 'Read-only.' adds nothing and slightly duplicates structured data. The rest does real work the annotations cannot: it discloses result ordering (oldest first), that uncommitted work is included, and what classes of evidence appear (rationales, reverted attempts, notes). It doesn't discuss volume, truncation, or cost for large histories, which keeps it at 4.

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?

Purpose is front-loaded in the first clause and the enumeration of returned evidence is tight rather than padded. The only waste is the trailing 'Read-only.' sentence, which restates the annotations. Overall dense but readable.

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 output schema, the description carries the return-value burden and does so well by listing exactly what the history contains. For a three-optional-parameter read tool the calling surface is fully covered. It lacks any statement about result size, depth limits, or pagination for long histories, which is the remaining gap.

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?

Schema coverage is 100%, so all three parameters are already documented in the schema, including the default-repo behavior via repo_id. The description only echoes 'path or symbol' and adds the oldest-first ordering, which is really a result trait rather than a per-parameter detail. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a concrete framing ('the history behind a path or symbol, oldest first') and enumerates the record types returned: edits with who/when/what, completed intents with rationales, reverted attempts, anchored notes, and uncommitted work. That makes the resource unmistakable versus siblings like get_symbol or blast_radius. It stops short of naming any sibling as an explicit alternative, so it lands at 4 rather than 5.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the tool for 'why is this code like this' questions, and the schema note 'with no symbol, the whole file' gives a scoping hint. There is no explicit when-not-to-use guidance and no routing to recall/recap/get_symbol for adjacent needs. Adequate but clearly gapped.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources