Skip to main content
Glama

scan_codebase

Idempotent

Analyze a codebase with tree-sitter to produce a structured architectural payload for code review, refactoring, planning, or Q&A. Includes AST analysis, change detection, and caching.

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
Behavior4/5

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

Annotations already include idempotentHint=true and destructiveHint=false; the description adds valuable context about writing the analysis payload to disk, caching behavior, and explicitly confirms the payload is pure architectural data with no AGENTS.md instructions. This goes beyond the annotations without contradicting them.

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?

The description is compact yet comprehensive, with a clear structure: purpose, behavior, supported languages, arguments, and return value. It is slightly verbose but every section adds value, and the front-loaded purpose sentence aids quick scanning.

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

Completeness4/5

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

The description covers all essential aspects: purpose, side effects, supported languages, parameter semantics (though flawed), and return value instructions. It is sufficiently complete for a complex tool with nested parameters and an output schema, though the parameter default inconsistency weakens completeness.

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

Parameters2/5

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

The description explains both parameters, but critically contradicts the schema on the default for force_full_scan: description says 'default: True' while schema states 'default: false'. This inconsistent guidance undermines the added semantics. Schema coverage is low (0% at top-level), but the nested descriptions exist, making the misstatement more harmful.

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 clearly states the tool's function with a specific verb and resource: 'Scan and analyze a codebase with tree-sitter, producing a structured context payload.' It distinguishes itself from siblings by explicitly directing users to generate_agents_md for AGENTS.md tasks and mentioning read_payload_chunk for retrieval.

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 ('when you need deep codebase understanding for any task') and when-not-to-use ('To generate or update AGENTS.md specifically, use generate_agents_md instead'). Also gives conditional guidance for force_full_scan, noting when to set it to False in incremental workflows.

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