Skip to main content
Glama

index_repo

Build or incrementally refresh a semantic search index for a local repository, re-embedding only changed files so updates stay fast and current.

Instructions

Build or incrementally refresh a semantic search index for a local repository.

Walks the repo, chunks every supported-language file by AST boundaries, embeds the chunks via a local Ollama server, and stores them in a per-repo LanceDB table. After the first build this is INCREMENTAL: only files whose content changed since the last run are re-embedded, so refreshing is cheap — run it freely (e.g. when index_status reports "stale"). A changed embedding model or force=True does a full rebuild. Requires a running Ollama (the semantic layer is built in; run myopic doctor to set it up) at MYOPIC_OLLAMA_URL (default http://localhost:11434) with the model pulled (MYOPIC_EMBED_MODEL).

Args: root: Absolute path to the repository to index. force: Rebuild the whole index even if an up-to-date one exists.

Returns: {mode, indexed_chunks, files, skipped, changed_files, deleted_files, git_sha, model} on success, or {"error": "..."} on failure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootYes
forceNo
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: incremental updates, full rebuild triggers, local Ollama requirement, environment variables, and return format including error handling. It also notes the per-repo LanceDB table, providing a complete picture of side effects and external dependencies.

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?

Although the description is detailed, it is well-structured with clear sections (behavior, prerequisites, args, returns). Every sentence adds value, with no repetition of schema information. It is front-loaded with the primary purpose and uses bullet-like formatting for Args and Returns.

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?

The description covers prerequisites, operational details, parameters, and return values, even without an output schema. It addresses the tool's complexity (incremental vs. full rebuild, external dependencies) and provides all necessary context for an agent to use it correctly.

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?

The input schema has no descriptions for either parameter (0% coverage), but the description compensates fully: 'root: Absolute path to the repository to index' and 'force: Rebuild the whole index even if an up-to-date one exists.' This clarifies both the meaning and the expected values.

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: 'Build or incrementally refresh a semantic search index for a local repository.' It specifies the resource (local repository), the action (build/refresh index), and the technical approach (AST chunking, Ollama embed, LanceDB storage). This distinguishes it from sibling tools like 'index_status' and 'code_search'.

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 usage guidance: 'run it freely (e.g. when index_status reports "stale")' and explains when a full rebuild occurs ('changed embedding model or force=True'). It also states prerequisites (Ollama server, model pulled) and references the sibling tool index_status, making the choice of tool clear.

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/SurajKGoyal/myopic'

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