cgis_get_structure
Display the containment hierarchy for a code symbol, listing contained modules, classes, and methods as a Mermaid diagram or JSON.
Instructions
Members of a module or class — or, for a package prefix, the modules it holds.
Follows containment (CONTAINS/DECLARES) only, so no call or import appears.
A package is not a node in the graph (#487), so its row and the edges to its
modules are synthesized for the answer and marked with a virtual file path.
For how the code connects use ``cgis_trace_flow`` (what it depends on) or
``cgis_analyze_impact`` (what depends on it).
Matches the CLI ``structure`` command. ``output_format="mermaid"`` (default) returns a
diagram of the hierarchy rooted at the given FQN; ``"json"`` returns the
joinable ``{root, nodes, edges}`` payload with real FQNs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fqn | Yes | Fully qualified name, e.g. pkg.module.Class.method. A unique dot-boundary suffix also resolves; an ambiguous one returns candidates. Use cgis_find_symbol to look a name up. | |
| depth | No | Maximum containment levels to descend (module → class → method). | |
| db_path | No | SQLite 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 |
| output_format | No | "mermaid" for a diagram, or "json" for a payload with real FQNs (case-insensitive). Any other value returns an error. | mermaid |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |