Skip to main content
Glama

Dependency graph

dependency_graph
Read-onlyIdempotent

Build import and reference graphs across TypeScript/JavaScript, Python, Rust, Go, Java, and Kotlin to reveal module structure and what a subtree depends on.

Instructions

Build the import and reference graph for TypeScript/JavaScript, Python, Rust, Go, Java and Kotlin. format: json, dot or mermaid. Use when: you want module structure or what a subtree depends on. Narrow with relative_path, depth, languages. Avoid when: you need usages of one symbol (symbol_references) or the impact of an edit (change_impact). Output: nodes[], edges[] {from, to, type, confidence}, external[] (top 50), unresolved[] (top 10), stats {externals, unresolved_imports}, limited, truncated. dot and mermaid return data.graph.

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": "dependency_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNofiles (imports), symbols (references/extends), or both (default files).
depthNoDirectory recursion cap (default 3, max 10).
formatNoOutput format (default json). dot/mermaid return data.graph.
languagesNoLanguage filter, e.g. ["ts","py","rs","go","java","kotlin"] (default: all supported).
max_edgesNoMax edges kept; more sets truncated (default 2000).
max_nodesNoMax file nodes (default 500).
include_testsNotrue includes test files/edges (default); false hides them.
relative_pathNoLimit the walk to this subtree (default: the workspace root).
include_externalNotrue aggregates npm/pip/node package nodes in external[]. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv4.5.0
    • removedInput schema / properties / include_external / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / include_external / description
      Previous value: -"1 aggregates npm/pip/node package nodes in external[]. Default 0."New value: +"true aggregates npm/pip/node package nodes in external[]. Default false."
    • removedInput schema / properties / include_external / maximum
      Removed value: -1
    • removedInput schema / properties / include_external / minimum
      Removed value: -0
    • changedInput schema / properties / include_external / type
      Previous value: -"integer"New value: +"boolean"
    • removedInput schema / properties / include_tests / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / include_tests / description
      Previous value: -"1 includes test files/edges (default); 0 hides them."New value: +"true includes test files/edges (default); false hides them."
    • removedInput schema / properties / include_tests / maximum
      Removed value: -1
    • removedInput schema / properties / include_tests / minimum
      Removed value: -0
    • changedInput schema / properties / include_tests / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/closed-world, and the description goes well beyond them: it discloses the returned collections (nodes, edges with type and confidence, external capped at 50, unresolved capped at 10), the stats block, and the limited/truncated flags. It also explains that dot and mermaid return data.graph rather than the JSON shape, which is behavior an agent cannot infer from annotations.

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?

The telegraphic, front-loaded layout is efficient: purpose first, then Use/Avoid/Output. Minor redundancy exists in restating 'format: json, dot or mermaid' and 'dot and mermaid return data.graph', both of which already appear in the schema's format parameter description.

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 present, the description compensates by enumerating the response fields, the external/unresolved caps, and the truncation signal. Combined with full schema coverage and the read-only annotations, an agent has everything needed to call this correctly and interpret the result.

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% and each of the nine parameters already carries its own default, bounds, and enum, so the schema does the heavy lifting. The description only adds a generic prompt to narrow with relative_path, depth, and languages, without clarifying interactions such as how depth and max_nodes combine. Baseline 3 is appropriate.

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?

States a specific verb and resource ('Build the import and reference graph') and enumerates the supported languages, which defines scope precisely. The 'Avoid when' line explicitly names symbol_references and change_impact, so an agent can separate this from its nearest siblings without reading 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?

Provides an explicit 'Use when' clause (module structure, subtree dependencies) and an explicit 'Avoid when' clause with the two alternative tools named. It also tells the agent how to narrow the call (relative_path, depth, languages), leaving little to inference.

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