Skip to main content
Glama

cgis_module_graph

Visualize a package's internal module graph: map sub-packages/modules and import, inheritance, and call dependencies with transitive reduction to reveal direct layering and cycles.

Instructions

How one package is built inside: its modules and the dependencies between them.

Nodes are the package's direct children, each sub-package one node (``expand``
lists every module instead). Edges are imports ``-->``, inheritance ``==>``
and calls ``-.->``, each kind transitively reduced so the direct layering
shows; an edge that closes a cycle is never dropped. Dependencies on code
outside the package are summarised per module under the diagram, not drawn.
Test modules and type-only imports are left out. The json form is
``{prefix, nodes, subpackages, edges:[{source,target,kind}], dropped, covered, outside}``;
``covered`` counts the imports not drawn because a drawn ``==>`` joins the
same pair: that arrow then also stands for the import, so read an import
closure over imports and extends together. An import that closes an import
cycle is always drawn.
Run ``cgis_ingest`` first.

Input Schema

NameRequiredDescriptionDefault
expandNoEvery module below the package instead of one node per sub-package.
layersNoEdge kinds to draw. Calls make the picture much denser.
prefixYesFQN prefix of the package as the graph names it, e.g. cgis.query (cgis_find_symbol shows it), matched on whole dot-segments. A directory above the ingest root, such as src., is dropped.
reduceNoDrop each edge implied by a longer path, per kind; cycles stay.
db_pathNoSQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path.graph.db
exclude_testsNoLeave test modules out.
output_formatNomermaid: a diagram plus a table of outside dependencies; json: data.mermaid

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.21.17

TDQS

A4/5.0
Behavior5/5

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

With no annotations the description carries the full burden and does so thoroughly: it discloses transitive reduction rules, that cycle-closing edges are never dropped, that test modules and type-only imports are excluded, that external dependencies are summarised rather than drawn, and how `covered` should be interpreted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded and the content is dense and useful, but the cycle rule is stated three separate times ("never dropped", "always drawn", plus the `covered` aside), and the json return shape is spelled out despite an output schema existing.

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

Completeness4/5

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

For a 7-parameter analysis tool with a full schema and an output schema, the description covers the prerequisites, exclusions, reduction semantics and output modes well; it only omits failure behaviour for an unknown prefix or missing database.

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 coverage is 100% and every parameter is already documented in the schema, including the same expand/reduce/cycles semantics the description restates; the description adds marginal interpretive value (e.g. that calls make the picture denser) rather than new parameter meaning.

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 opening sentence names a specific resource (a package's internal module/dependency graph) and the description then pins down exactly what nodes and edges represent, so an agent can distinguish it from package-level siblings like cgis_overview or cgis_get_structure without opening the schema.

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?

It gives one hard prerequisite ("Run cgis_ingest first") and notes that `expand` lists every module instead, but never says when to choose this over alternative structural tools such as cgis_overview or cgis_fractal, and offers no when-not guidance.

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