structure
Perform code intelligence analysis: get symbol outlines, cyclomatic complexity, class hierarchies, AST paths, and source exploration for files and directories.
Instructions
Code-intelligence (codegraph-compatible) structural analysis facade. Covers codegraph_explore (multi-symbol source), codegraph_class_hierarchy, codegraph_class_inspect, codegraph_sitemap, codegraph_ast_path, and code-outline/complexity in one tool. Pick a capability via action:
action=outline — AST-based symbol outline for a file or directory. Params: file_path, language, depth.
action=analyze — complexity + structure analysis (cyclomatic, nesting, cohesion). Params: file_path, language.
action=signatures — LIGHTWEIGHT method-directory (~25 %% of full tokens). Lists every method as 'name →returnType(Np) startLine-endLine' grouped by class. Use FIRST for large files (>500 lines) to pick methods by name, then action=read to fetch bodies. Supports Python, Java, and other languages. Params: file_path[, language] (language auto-detected from file extension when omitted).
action=ast_path — AST path from a specific node up to the file root (navigate the parse tree, codegraph_ast_path equivalent). Params: file_path, line, column.
action=sitemap — high-level symbol sitemap of a directory or the whole project (what is defined where, codegraph_sitemap equivalent). Params: mode (full|api|module|flat), directory (relative path, optional), language, max_files. NOTE: takes a directory, not file_path — omit directory for the whole project.
action=class_tree — class inheritance/subclass hierarchy (codegraph_class_hierarchy equivalent). Params: class_name, mode (subclasses|supers|tree).
action=class_detail — detailed class inspection: fields, methods, visibility, inherited members (codegraph_class_inspect equivalent). Params: class_name, language.
action=explore — multi-symbol source explorer: show source of several related symbols grouped in one capped response (codegraph_explore equivalent). Params: symbols, language.
action=read — extract a file section (single) or multiple sections (batch). Single: file_path + start_line [+ end_line + column bounds]. Batch: requests=[{file_path, sections:[{start_line, end_line}]}].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Which capability to invoke. One of: analyze, ast_path, class_detail, class_tree, explore, outline, read, signatures, sitemap | |
| scope | No | Action discriminator (e.g. point|graph). | |
| mode | No | Action sub-mode (e.g. summary|cycles). | |
| file_path | No | Target file path. | |
| symbol | No | Symbol/function name. | |
| function_name | No | Function name (alias of symbol). | |
| query | No | Search query/pattern. | |
| language | No | Language hint (usually auto). | |
| limit | No | Max results. | |
| output_format | No | Output format (toon|json). |