Skip to main content
Glama

get_graph_stats

Analyze a codebase to retrieve dependency graph statistics, including total modules, total dependencies, and circular dependencies detected.

Instructions

Returns statistics about the dependency graph including total modules, total dependencies, and any circular dependencies detected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
src_dirNoSource directory to analyzesrc
scan_dirsNoOptional list of directories to scan (relative to project root unless absolute). Overrides src_dir.
project_rootNoProject root directory (defaults to server cwd if omitted)
ignore_patternsNoRegex patterns for files to ignore (applied to normalized paths).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral disclosure burden. It does convey that this is a read-like operation returning computed statistics, including circular dependency detection. However, it does not disclose whether the graph is built on demand or read from cache, what counts as a dependency, or any side effects from scanning directories.

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?

The description is one focused sentence that front-loads the action and resource, then lists the key return values. There is no filler, repetition, or unnecessary detail.

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?

The description is adequate for a simple stats tool, but there is no output schema and no annotations, so more detail about the return shape or the computation context would help. It mentions three result categories but does not describe their structure, types, or how the dependency graph is sourced.

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%, so the schema already documents all four optional parameters well. The tool description does not add parameter-level meaning, but it does not need to because the schema is clear about src_dir, scan_dirs, project_root, and ignore_patterns.

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 states a specific verb ('Returns') and resource ('statistics about the dependency graph'), and enumerates the key outputs: total modules, total dependencies, and circular dependencies. It does not explicitly differentiate from sibling tools like get_dependencies or get_impact, but the 'statistics' framing makes the core purpose clear.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool instead of siblings such as get_dependencies, get_impact, or invalidate_graph_cache. The description implies a use case only through the tool name and resource, but never states the selection criteria or exclusions.

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