Skip to main content
Glama

Explain a Symbol

explain_symbol
Read-onlyIdempotent

Explains a symbol's source plus selected environment axes—callers, callees, implementations, tests, siblings, quality—in one call, replacing multiple separate queries.

Instructions

Explain a symbol: its source PLUS a chosen environment, as ONE dense AI-Builder-Markdown slice - the cold-read in a single call instead of 4-6 (get_context + find_usages + find_implementations + find_tests_for + ...). 'include' selects the environment axes (any combination): callers (the members that reference it, with their bodies, and their owner types as structure - not the calling types whole), callees (what it calls/depends on, depth 1), implementations (the types implementing it, if it's an interface), tests (its covering test cases), siblings (naming/file-convention kin), quality (complexity / efferent-coupling hotspot metrics). A partial type renders as ONE block per project it is compiled into (its declaration fragments are folded, a leading comment says which files) instead of one identical block per file; a file compiled into several projects whose block reads the same in each renders once, naming them. An empty include returns just the symbol's source - and then the manifest names the axes you could have asked for, so that answer is a stated choice rather than a silent default; an include token that names no axis is reported as dropped, whether or not a sibling token was valid. A leading manifest comment discloses what each merge axis actually found - so '(none)' is an honest negative (no impl / no caller / no test), not 'not asked' - unless its 'run:' segment says the analysis run was incomplete. Pass a type or method simple name (use find_symbol to disambiguate). Recall-safe (reads persisted facts); prefer it over export_markdown for one symbol's world. Multi-TFM solutions are deduplicated to one logical project per name (NEWEST TFM's instance, matching find_symbol's view).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sessionId": "<sessionId>",
      "symbol": "<symbol>"
    },
    "name": "explain_symbol"
  }
}

Input Schema

NameRequiredDescriptionDefault
leanNoLean slice (default TRUE): drop the <AI_CONTEXT_SPEC>/<AI_CONTEXT_META> format-rules preamble and omit enabled-but-empty graph sections. Set false for the full AI-Builder-MD document with the format contract.
budgetNoOptional token budget (floored at 8000). Compacts/drops method bodies and, when the neighborhood overflows, drops the least-relevant types. The center symbol is always kept - with its full source when that fits, otherwise as STRUCTURE (identity, members, every method signature) plus a leading note that names the measured size of the full-code render and the budget that would hold it, so a 2000-line type under budget:8000 costs ~2000 tokens, not ~24000. The bundled environment (callers / tests / siblings / implementations) is BUDGET-BOUND - under a tight budget it is dropped to fit (a leading comment names the drops so you can ask for one by name). Omitted, the slice still renders against a ceiling (the active MCP profile's token budget, else a ~10000-token default budget) that bounds the merged environment - relevant above all with include=["callees"], whose outward neighborhood is the widest slice this server produces.
symbolYesThe type or method simple name to center on (use find_symbol to disambiguate), or the qualified Type.Member form to focus ONE declaration of a shared method name - the same string find_usages / find_tests_for / impact_of_change resolve. A bare name that matches several declarations seeds them all (a whole family can then be budget-capped), and the manifest says so and names the qualified form.
includeNoWhich environment axes to include (any combination, case-insensitive): callers, callees, implementations, tests, siblings, quality. Empty/omitted = just the symbol's source.
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution."New value: +"The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantially beyond them: manifest comments distinguishing '(none)' honest negatives from 'not asked', a 'run:' segment flagging incomplete analysis, dropped unknown include tokens being reported, per-project block folding and multi-TFM dedup. It also discloses budget-driven dropping and that the center symbol degrades to STRUCTURE rather than vanishing — exactly the behavior an agent needs to interpret output.

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?

Front-loaded with the core contract, and nearly every sentence carries new information (axis semantics, manifest honesty, dedup rules). It is nonetheless a single very long paragraph with no structural breaks, and the trailing multi-TFM dedup sentence is the weakest-value item given find_symbol parity.

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

Completeness5/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 full burden and does so: it describes the return artifact, the manifest preamble, the lean-vs-full document difference, and how truncation appears in the output. Nothing an agent needs to call it correctly or interpret the result is missing.

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?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining cross-parameter behavior the schema does not — that an empty include returns source only and the manifest names the available axes, that invalid include tokens are reported as dropped, and that a bare symbol name seeds all matching declarations and can be budget-capped. It largely restates the budget and lean semantics already fully documented in the schema, which keeps it from a 5.

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?

Opens with a specific verb+resource ('Explain a symbol: its source PLUS a chosen environment') and immediately defines the output artifact (one dense AI-Builder-Markdown slice). It explicitly distinguishes itself from the composite alternative ('instead of 4-6: get_context + find_usages + find_implementations + find_tests_for') and from export_markdown/find_symbol, so an agent can place it among siblings without opening any schema.

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

Usage Guidelines5/5

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

States when to use it (the cold-read in a single call, one symbol's world), when to use something else ('use find_symbol to disambiguate', 'prefer it over export_markdown for one symbol's world'), and what an empty 'include' means. The 'prefer it over' clause plus the named alternatives covers both directions of routing.

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