Skip to main content
Glama

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
NameRequiredDescriptionDefault
projectNoProject name or path (auto-detects if omitted)
typeNoFilter by entity type
limitNoMax results to return (default: 100)

Implementation Reference

  • 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,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/giauphan/codeatlas-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server