Skip to main content
Glama

Dependency graph

project_dependency_graph
Read-onlyIdempotent

Build import and reference graphs for TypeScript, JavaScript, Python, Rust, Go, Java, and Kotlin to inspect module structure and subtree dependencies in JSON, DOT, or Mermaid.

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 (project_symbol_references) or the impact of an edit (project_change_impact). Output: nodes[], edges[] {from, to, type, confidence}, external[], unresolved[], stats, 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": "project_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_testsNo1 includes test files/edges (default); 0 hides them.
relative_pathNoLimit the walk to this subtree (default: the workspace root).
include_externalNo1 aggregates npm/pip/node package nodes in external[]. Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.21.0
    • changedInput schema / properties / max_edges / description
      Previous value: -"Max edges (default 2000)."New value: +"Max edges kept; more sets truncated (default 2000)."
  2. Changed1 schema field changedv1.14.0
    • changedInput schema / properties / languages / description
      Previous value: -"Language filter, e.g. [\"ts\",\"py\"] (default: all supported)."New value: +"Language filter, e.g. [\"ts\",\"py\",\"rs\",\"go\",\"java\",\"kotlin\"] (default: all supported)."
  3. Addedv1.13.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so the safety profile is covered. The description goes further by disclosing the output shape (nodes[], edges[] with from/to/type/confidence, external[], unresolved[], stats, truncated) and the truncation behavior, plus the format-dependent difference where dot/mermaid return data.graph. It stops short of stating cost or performance characteristics for large graphs, which keeps it at 4 rather than 5.

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?

Front-loaded with the capability, then 'Use when', 'Avoid when', and output shape in labelled fragments. Dense but zero filler; every clause conveys selection or invocation information an agent would otherwise have to infer.

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?

There is no output schema, but the description summarizes the return object field by field, including the truncation flag and the format-specific data.graph path. Combined with 9 optional parameters fully documented in the schema and annotations covering safety, an agent has everything needed to call this correctly.

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 baseline is 3. The description adds value beyond the schema by explaining the relationship between format and return shape ('dot and mermaid return data.graph') and by framing relative_path, depth and languages as the narrowing levers for subtree scoping. The remaining parameters (max_nodes, max_edges, include_tests, include_external, kind) are left entirely to the schema.

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?

The description opens with a specific verb and resource: 'Build the import and reference graph', and enumerates the supported languages (TypeScript/JavaScript, Python, Rust, Go, Java, Kotlin). It also names the two sibling tools it is distinct from, so an agent can differentiate it 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?

It provides explicit 'Use when' guidance ('module structure or what a subtree depends on') and explicit 'Avoid when' routing to project_symbol_references for single-symbol usages and project_change_impact for edit impact. It also names the narrowing parameters (relative_path, depth, languages), so both selection and initial parameter choice are covered.

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