Skip to main content
Glama

get_codebase_map

Map repository structure via AST symbol outline of classes, functions, and exports to save 70-85% tokens on coding tasks.

Instructions

Extracts a token-efficient AST symbol outline map (classes, interfaces, functions, methods, exported types) across the repository.

Behavior: Read-only operation. Zero file modifications, zero persistent side-effects, and zero network calls. Returns structured Markdown.

When to use: Call this at the start of a coding task to inspect repository architecture, directory structure, and symbol hierarchies with 70%~85% token savings.

When NOT to use: Do NOT use this if you need full function implementations (use read_file_content instead), or if you already know the target task and want only relevant files (use extract_relevant_context instead).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirNoPath to repository root directory. Defaults to current working directory ("."). Respects .gitignore and built-in binary exclusions.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.2.0
    • changedInput schema / properties / rootDir / description
      Previous value: -"Path to repository root directory (default: current working directory)"New value: +"Path to repository root directory. Defaults to current working directory (\".\"). Respects .gitignore and built-in binary exclusions."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: read-only, zero modifications, zero side-effects, zero network calls, and returns structured Markdown. This is exactly the behavioral transparency needed for a tool with no annotation support.

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

Conciseness5/5

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

Well-structured with clear sections (purpose, behavior, usage). Every sentence adds value and the most critical information (read-only, usage guidance) is front-loaded.

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

Completeness5/5

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

For a simple read-only tool with one optional parameter and no output schema, the description is complete: it explains what it returns, when to use it, and when not to. No essential information is missing.

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 description coverage is 100% for the single parameter rootDir, which already explains its purpose and defaults. The description does not add additional parameter semantics, so the baseline of 3 is appropriate.

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?

Clearly states the verb 'Extracts' and the resource 'AST symbol outline map' with specific contents (classes, interfaces, functions, methods, exported types). It also differentiates itself from siblings by mentioning token savings and scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'When to use' and 'When NOT to use' sections, naming alternatives (read_file_content and extract_relevant_context) and the conditions that select them. This leaves no ambiguity for the agent.

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