Skip to main content
Glama

Explain Code Symbol

explain_code
Read-onlyIdempotent

Explains any code symbol by locating its definition and workspace references, finding related tests, and surfacing associated architectural memories to clarify how it fits.

Instructions

Explain a code symbol: where it is defined, who references it across the workspace, related tests, and associated architectural memories.

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
pathNoOptional workspace directory to scan.
depthNoAnalysis depth.standard
symbolNoAlias for target symbol identifier (provide target or symbol).
targetNoSymbol or identifier to explain (provide target or symbol).
namespaceNoOptional Memoria namespace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds genuine value by disclosing what the call actually gathers (definition, references, tests, memories), which tells the agent this is an aggregation pass, not a simple lookup. It still does not say how expensive a deep scan is or what happens when no symbol resolves.

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?

A single front-loaded sentence, with the verb and resource first and the output facets enumerated after the colon. Every clause (definition, references, tests, memories) conveys distinct information about what the agent will receive; there is no filler.

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?

For a five-parameter, all-optional read tool with no output schema, the description covers the substance of what comes back and therefore doesn't need to explain return values. The one real gap is that nothing says at least one of target or symbol is needed in practice, even though the schema marks no parameter required. Also the Memoria namespace concept is left unexplained.

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 description coverage is 100%, so all five parameters are already documented in the schema, including the target/symbol aliasing and the depth enum. The description adds only the loose hint that the scan covers a workspace. With the schema doing the heavy lifting, 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 uses a specific verb ("explain") on a specific resource ("code symbol") and enumerates the four facets returned: definition site, workspace references, related tests, and architectural memories. That is well beyond a restatement of the name. It stops short of explicitly distinguishing itself from the sibling search_code, so the agent must infer that 'explain' is richer than 'search'.

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 by the word "explain" and by the mention of scanning "across the workspace" — an agent can guess this is for comprehension of an existing symbol rather than discovery. There is no statement of when to prefer it over search_code, no cost/latency caveat for deep scans, and no exclusions.

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