get_project_structure
Analyze codebase structure to identify modules, classes, functions, and variables with file paths and line numbers. Filter by entity type to understand project architecture and locate specific code components.
Instructions
Get all modules, classes, functions, and variables in the analyzed project. Returns entity type, name, file path, and line number.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Project name or path (auto-detects if omitted) | |
| type | No | Filter by entity type | |
| limit | No | Max results to return (default: 100) |
Implementation Reference
- index.ts:146-172 (handler)The handler logic for the 'get_project_structure' tool, which filters nodes from the loaded analysis graph based on type and limit.
async ({ project, type, limit }) => { const loaded = loadAnalysis(project); if (!loaded) { return { content: [{ type: "text" as const, text: "No analysis data found. Run 'CodeAtlas: Analyze Project' in VS Code first." }] }; } let nodes = loaded.analysis.graph.nodes; if (type && type !== "all") { nodes = nodes.filter((n) => n.type === type); } const maxResults = limit || 100; const truncated = nodes.length > maxResults; nodes = nodes.slice(0, maxResults); const result = { project: loaded.projectName, projectDir: loaded.projectDir, total: loaded.analysis.graph.nodes.length, showing: nodes.length, truncated, stats: loaded.analysis.stats, entities: nodes.map((n) => ({ name: n.label, type: n.type, filePath: n.filePath || null, line: n.line || null,