Skip to main content
Glama

reference_graph

Read-only

Builds a class dependency graph from IDE cross-references, tracing outgoing or incoming dependencies to a set depth and summarizing edges by artifact, methods, and module boundaries.

Instructions

Build a dependency graph between classes from the IDE's cross-reference store: starting from root classes, follow outgoing dependencies or incoming dependents up to a depth. Edges are folded to artifact level and list the methods/members involved; edges between different modules are flagged and summarized as boundaries. Only classes are expanded further; tables, EDTs, enums and others appear as leaves.

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": {
      "roots": "<roots>"
    },
    "name": "reference_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNo
depthNo
rootsYesArtifact IDs such as /Classes/MyClass
maxNodesNo
directionNooutgoing
expandModulesNoOnly expand classes in these modules beyond the roots (for example ["Contoso", "Fabrikam"]); others stay as leaves.

Output Schema

NameRequiredDescriptionDefault
okYes
edgesNo
errorNo
nodesNo
warningsNo
truncatedNo
boundariesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.16.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only cover readOnlyHint and openWorldHint; the description adds genuinely non-obvious behavior — edges are folded to artifact level, carry the member list, cross-module edges are flagged as boundaries, and only classes are recursively expanded while tables/EDTs/enums are leaves. That is real context beyond the annotations, though it omits cost/truncation behavior for depth and maxNodes.

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?

Three dense sentences, front-loaded with the core operation and followed by folding and expansion rules; essentially no filler. The opening sentence is long but carries required detail rather than padding.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter graph tool with an output schema, the description covers the graph model well and is right not to restate return values. However, with only a third of parameters documented in the schema, gaps around kind and maxNodes truncation remain, which matters for correct invocation.

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 33% (only roots and expandModules are documented), so the description has to compensate. It does explain roots, direction and depth through the traversal sentence, but leaves kind and maxNodes — including the 200/1000 cap and default — entirely unaddressed in both schema and prose.

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 gives a specific verb and resource ("Build a dependency graph between classes") plus the traversal mechanics (roots, outgoing/incoming, depth). It never names a sibling such as reference_tree or reference_impact, so the agent gets no explicit contrast, but the semantics are distinct enough to identify the operation.

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: the mention of roots, direction and depth sketches the traversal scenario but there is no "use this when" statement, no prerequisite, and no condition selecting it over the closely named reference_* siblings. An agent can infer intent, but must guess at alternatives.

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