Skip to main content
Glama

index_codebase

Idempotent

Build or refresh a local semantic search index for your codebase, enabling fast semantic code search via Ollama. Only changed files are re-embedded, so indexing is incremental.

Instructions

Build or refresh the LOCAL semantic search index for a directory tree.

Incremental: only files whose mtime/hash changed are re-embedded. Stored in the server's data dir (~/.cache/ollama-agent), not in the repo. Run once per repo; search_code refreshes it automatically afterwards. include_globs defaults to common source/doc extensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootYes
forceNo
include_globsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the idempotentHint annotation, the description reveals the incremental re-embedding behavior, the storage location in the server's data dir rather than the repo, and that search_code auto-refreshes the index. This adds meaningful behavioral context that annotations alone do not convey.

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 compact and front-loaded: main purpose first, then incremental behavior, storage, usage positioning, and parameter default. Every sentence contributes information, with no filler or repetition.

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?

For a moderately complex indexing tool with no output schema, the description covers purpose, incremental semantics, storage side effects, run cadence, and default globs. Missing details such as force semantics and expected return values keep it just shy of fully complete, but the agent has enough to call it correctly in most cases.

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?

Schema description coverage is 0%, so the description must compensate. It only explains include_globs by noting its default; root and force are left undocumented. Root is somewhat inferable from 'directory tree,' but force's effect is never described, which is a meaningful gap for a 3-parameter tool with zero schema descriptions.

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 opens with a specific verb-resource pair: 'Build or refresh the LOCAL semantic search index for a directory tree.' It clearly identifies the tool's scope (local indexing) and differentiates it from the sibling search_code by stating that search_code refreshes the index automatically, so an agent can distinguish them.

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?

The description gives practical guidance: 'Run once per repo' and notes that search_code refreshes the index automatically afterwards, implying search_code is the tool for queries. It does not explicitly enumerate when not to use the tool or compare against all siblings, but the context is clear enough for confident selection.

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