Skip to main content
Glama

Tarjan SCC Circular Import Detector & Topological Blast-Radius Solver

audit_module_dependency_cycles
Read-onlyIdempotent

Analyze module import maps to detect circular dependencies, compute parallel build waves, and trace downstream change blast radius so you know which files to retest after an edit.

Instructions

Runs Tarjan's Strongly Connected Components (SCC) algorithm on a module import map to detect circular dependencies, compute parallel topological build waves, and trace downstream change blast radius. Use when auditing multi-file import graphs for circular cycles or determining which downstream files must be re-tested after an edit; for extracting function-level symbols and cyclomatic complexity inside a single source file, use analyze_ast_symbol_graph instead. Read-only call (32 KB, 60 RPM): accepts 'modules_json' (with enum defaults), uses '?demo=true' or L402 (20 sats); HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
modules_jsonYesJSON string or object mapping each module name to its array of imported module names (e.g. '{"a":["b"],"b":[]}').
analysis_scopeNoGraph analysis output mode; defaults to 'cycles_waves_and_blast_radius' when omitted.

Output Schema

NameRequiredDescriptionDefault
total_modulesYesTotal number of graph vertices analyzed.
circular_scc_groupsYesStrongly connected component cycles discovered via Tarjan's algorithm.
topological_build_wavesYesDependency-ordered parallel build/test execution waves.
transitive_blast_radiusYesAll upstream callers transitively impacted by the modified modules.
circular_dependencies_detectedYesTrue if one or more circular dependency cycles exist.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.3

TDQS

A4.9/5.0
Behavior5/5

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

While annotations cover read-only status, the description provides critical operational context beyond structured data, including rate limits (60 RPM), payload size (32 KB), error handling (HTTP 400), and the underlying algorithmic approach.

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 tool definition is extremely dense, but every piece of information serves a purpose: describing the function, the use case, the alternative, and the operational constraints.

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?

The description provides a complete picture of the tool's scope, mechanism, and limits, making it highly reliable for an agent to invoke it correctly without needing external documentation.

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?

With 100% schema coverage, the baseline is high. The description adds semantic value by specifying that the input is a mapping of module names to import arrays (an 'import map'), providing structure context that complements 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 provides a highly specific technical explanation, naming the algorithms (Tarjan's SCC) and the resource it operates on (module import maps) to detect specific, complex issues like circular dependencies and blast radius.

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 clearly delineates the correct use case (auditing multi-file import graphs) and explicitly directs the agent away from the correct alternative sibling tool ('analyze_ast_symbol_graph') for single-file analysis.

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