Skip to main content
Glama

Get the reference diagram of one document

get_reference_diagram

Render and return the deterministic PlantUML component diagram of one source document's reference neighbourhood (the frozen rulebook specmgr://reference-graph §2–§5): one node per artifact (label = the document title, truncated to…

Instructions

Render and return the deterministic PlantUML component diagram of one source document's reference neighbourhood (the frozen rulebook specmgr://reference-graph §2–§5): one node per artifact (label = the document title, truncated to SPECMGR_DIAGRAM_MAX_TITLE, default 40), a stereotype + colour per artifact type, nodes grouped into per-domain curly-brace component groups (one per non-empty domain, closed with } -- the 2026-10-15 corrected form), one label-free edge per unique reference ({src} --> {dst}, the referenced item carries the incoming arrow), every edge lying on a cycle (SCC-based) drawn with the red label-free -[#red]-> arrow, and every reference whose target cannot be resolved on disk drawn as a top-level <<UNRESOLVED>> node. type is the source document's domain (one of adr, req, uc, tsk, qa, prb, gol, rsk, dec, sop, feat, vcr, sysrs, txt) and id the source's own identifier; depth (1..5, default 1) is the forward BFS depth; reverse=True is additive (the forward expansion to depth plus the direct incoming references to the source, direct-only on the incoming side); include_feat=False drops every FEAT node except the explicitly requested source (then every edge touching a dropped node); title overrides the diagram title (default: the source's H1; sanitized but never truncated). Guard order: id (path-injection attempt or wrong format -- for type="feat" the full feat-NNN-slug only; a bare feat-NNN is rejected, use list_feat to discover the exact id) and depth are both a ValueError raised before any filesystem access; a missing source raises the source domain's own XNotFoundError; an existing-but-broken source returns the non-raising ParseFailureResult (error/path/id, the error text byte-identical to the domain's list_<d> failed-row error for the same file (ADR 9080b37c) for the 13 whole-body domains -- time-qualified by ADR 3982712a for feat; for adr (whose list_adr carries no failed row: broken ADRs are skipped), the leg-read AdrParseError's own text). Returns PlantUML source (not a specmgr document) -- run it through specmgr plantuml-check (CLI) or the validate_plantuml tool for a validation verdict.

Input Schema

NameRequiredDescriptionDefault
idYes
typeYes
depthNo
titleNo
reverseNo
include_featNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.38.0
    • changedInput schema / properties / type / enum
      Previous value: -[
      -  "adr",
      -  "req",
      -  "uc",
      -  "tsk",
      -  "qa",
      -  "prb",
      -  "gol",
      -  "rsk",
      -  "dec",
      -  "sop",
      -  "feat",
      -  "vcr",
      -  "sysrs"
      -]New value: +[
      +  "adr",
      +  "req",
      +  "uc",
      +  "tsk",
      +  "qa",
      +  "prb",
      +  "gol",
      +  "rsk",
      +  "dec",
      +  "sop",
      +  "feat",
      +  "vcr",
      +  "sysrs",
      +  "txt"
      +]
  2. First observedv0.36.0

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: guard order and which checks raise ValueError before any filesystem access, missing source raising the domain's XNotFoundError, broken source returning the non-raising ParseFailureResult with its error/path/id shape, byte-identical error text guarantees, and the adr exception. It also states the return is PlantUML source, not a specmgr document, and names the validation path.

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

Conciseness3/5

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

Information density is high and the primary purpose is front-loaded, but the body is one unbroken paragraph of nested parentheticals with spec citations ('specmgr://reference-graph §2–§5', 'the 2026-10-15 corrected form', ADR hashes) that add bulk without changing how an agent calls the tool. It is sized for the complexity but poorly structured for scanning.

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?

For a six-parameter render tool with an output schema already present, every decision an agent must make is covered: domain/id format, depth semantics, reverse and include_feat interactions, title override, error taxonomy, and the follow-up validation step. Nothing needed to invoke it correctly is missing.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate and it does for every parameter: type is given as the source's domain with the enum spelled out, id is the source's own identifier with the feat full-slug-vs-bare-id trap and the list_feat escape hatch, depth is bounded 1..5 with default 1, reverse is described as additive forward-plus-direct-incoming, include_feat defines cascading edge removal, and title defines default and sanitization/no-truncation behavior.

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?

Opens with a precise verb+resource: 'Render and return the deterministic PlantUML component diagram of one source document's reference neighbourhood', and enumerates exactly what the diagram contains (nodes per artifact, per-domain groups, edges, cycle edges, UNRESOLVED nodes). It scopes to 'one document', which implicitly separates it from the get_reference_diagram_all sibling, but never names that sibling or otherwise routes between them.

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 context is implied by the scoping ('one source document') and by the closing instruction to run the output through specmgr plantuml-check or validate_plantuml, which is genuinely actionable. However there is no explicit when-to-use/when-not guidance and no comparison to the near-identical get_reference_diagram_all or to list_references, so the agent must infer the choice.

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

Deploy Server

Other Tools