Skip to main content
Glama

scan_codebase

Idempotent

Scan and analyze a codebase using tree-sitter AST analysis to produce a structured context payload. Enables deep codebase understanding for code review, refactoring, and planning.

Instructions

Scan and analyze a codebase with tree-sitter, producing a structured context payload.

Performs AST analysis, change detection, and caching. Writes the analysis payload to disk and returns instructions to retrieve it via read_payload_chunk. The payload contains pure architectural data — no AGENTS.md writing instructions.

Use this tool when you need deep codebase understanding for any task (code review, refactoring, planning, Q&A). To generate or update AGENTS.md specifically, use generate_agents_md instead — it orchestrates the full workflow automatically.

Supported languages: Python, C#, TypeScript, JavaScript, Go.

Args: params (ScanCodebaseInput): Input parameters containing: - project_path (str): Path to the project root (default: ".") - force_full_scan (bool): Ignore cache and rescan everything (default: True). Set to False only when called as part of an incremental update workflow.

Returns: str: JSON with total_chunks and instructions to call read_payload_chunk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Description discloses behavioral traits not in annotations: writes analysis payload to disk, returns instructions for chunked retrieval, and clarifies payload contents (pure architectural data, no AGENTS.md instructions). This complements annotations which already indicate idempotency and non-destructiveness.

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 introductory paragraph, usage note, supported languages list, and formal Args/Returns sections. Concise without redundancy; every sentence adds value.

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 complex tool with output schema, description covers workflow, parameters, side effects, return format, and supported languages. No missing information that would hinder correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite low schema description coverage (0%), description provides comprehensive parameter details: explains project_path default, force_full_scan default and usage context (set to False only for incremental updates). This adds significant meaning beyond the schema fields.

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?

Description clearly states verb 'Scan and analyze' and resource 'codebase', specifies output 'structured context payload', and distinguishes from sibling tools like generate_agents_md. It also details the workflow (AST analysis, caching, writing to disk, retrieving via read_payload_chunk).

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?

Explicitly states when to use ('for any task needing deep codebase understanding') and when not to use ('to generate or update AGENTS.md, use generate_agents_md instead'). Also provides guidance on the force_full_scan parameter for incremental updates.

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

Install Server

Other Tools

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/nushey/agents-md-generator'

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