Skip to main content
Glama

generate_repo_map

Build a compact AST symbol map of classes, methods, and functions across a repo to cut LLM context tokens. Use it for a quick high-level codebase index.

Instructions

Generates an ultra-compressed AST symbol token map (classes, methods, functions) tailored for LLM chat prompts and extreme context window savings.

Behavior:

  • Read-only: Extracts AST signatures without writing or modifying files.

  • Idempotent: Deterministic symbol catalog for the same codebase state.

  • 100% Offline: Local AST extraction; zero external API calls.

Usage Guidelines:

  • When to use: Provide the LLM with an immediate high-level index of all classes and functions across the repository in minimal tokens (~5-15 tokens per file).

  • Sibling Routing: For full function signatures with parameter types and docstrings, use 'get_project_context_tree'. For 1st-degree context around a specific focus file, use 'get_smart_skeleton_context'.

Returns: Compact Markdown symbol map indexed by file path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_tokensNoMaximum token budget for the repo map (default: 4000).
project_rootNoRoot directory of the repository to map (default: current directory)..

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / max_tokens / description
      Added value: +"Maximum token budget for the repo map (default: 4000)."
    • addedInput schema / properties / project_root / description
      Added value: +"Root directory of the repository to map (default: current directory)."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well: it declares read-only ('without writing or modifying files'), idempotent/deterministic, and 100% offline with zero external API calls. These are exactly the behavioral traits an agent needs before invoking a codebase scan.

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

Conciseness4/5

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

Front-loaded purpose followed by tight categorized bullets; every line is scannable and earns its place. The 'Returns' line is mildly redundant given an output schema exists, keeping this just short of a 5.

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?

Given an output schema exists, the description need not explain return values, yet it briefly does so anyway. Purpose, scope, alternatives, behavioral profile, and output shape are all present, leaving no gap for an agent.

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%, so both parameters (max_tokens, project_root) are already documented in the schema and the description need not repeat them. It adds no format/semantics beyond the schema, which is the correct baseline-3 situation.

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?

The description states a specific verb+resource+output: 'Generates an ultra-compressed AST symbol token map (classes, methods, functions)'. It also names the exact siblings it differs from (get_project_context_tree, get_smart_skeleton_context), so an agent can distinguish it without opening any schema.

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?

There is an explicit 'When to use' condition (give the LLM a high-level index across the repo in minimal tokens) plus explicit 'Sibling Routing' rules that name the alternatives and the condition selecting each. Nothing is left to inference.

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