Skip to main content
Glama

Index codebase

scratchbook_index

Index or refresh a codebase so it can be semantically searched. Incremental updates only re-embed changed files and respect .gitignore.

Instructions

Index or refresh a codebase into the scratchbook so it can be semantically searched. Incremental — only files changed since last run are re-read and re-embedded. Respects .gitignore (uses git ls-files when available). Run once when you start working on a project, and again after significant edits. Pass the absolute project root as path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoAbsolute path to the codebase root. Defaults to the server's cwd.
reindexNoForce a full re-embed of every file, ignoring change detection.
Behavior4/5

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

The description discloses key behavioral traits: incremental processing ('only files changed since last run are re-read and re-embedded'), respect for .gitignore, and use of `git ls-files`. Since no annotations are provided, the description carries the full burden and does a solid job, though it omits potential runtime costs or side effects (e.g., index storage impact).

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?

The description is three sentences, each earning its place. It front-loads the core purpose, then adds incremental behavior, gitignore handling, and usage guidance. There is no redundancy or fluff.

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 the essential context: purpose, usage timing, and key behaviors. It does not explain return values, but for an indexing action with no output schema, that is less critical. The only minor gap is not explicitly detailing the `reindex` parameter in the description, though it is implied by the incremental explanation.

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 coverage is 100% with clear descriptions for both `path` and `reindex`. The description reinforces the `path` parameter ('Pass the absolute project root as path') and indirectly explains `reindex` through the incremental behavior, but it doesn't add substantial new meaning beyond the schema. The incremental description does provide context for why `reindex` might be needed.

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: 'Index or refresh a codebase into the scratchbook so it can be semantically searched.' It uses a specific verb ('Index') and resource ('codebase'), and distinguishes itself from sibling tools like scratchbook_search and scratchbook_outline by focusing on the indexing/preparation step rather than querying or summarizing.

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

Usage Guidelines4/5

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

Provides explicit usage timing: 'Run once when you start working on a project, and again after significant edits.' This gives clear context on when to invoke the tool. It does not mention alternatives or when-not-to-use, but the context is sufficient for an agent to decide appropriately in most scenarios.

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/jinyaolin/scratchbook'

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