Skip to main content
Glama

index_document

Index a local document (PDF, Markdown, code, etc.) into a searchable knowledge base by splitting into chunks, embedding, and storing vectors. Re-indexing replaces old chunks automatically.

Instructions

Index a document into the knowledge base so it can be searched.

Reads the file at file_path, splits it into overlapping chunks, embeds each chunk using nomic-embed-text via Ollama, and stores the vectors in ChromaDB. Re-indexing the same file is safe — old chunks are replaced automatically.

Args: file_path: Absolute path to the file to index. Supported types: .pdf .md .txt .py .js .ts .json .yaml .yml

Returns: A summary string describing what was indexed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Describes the full pipeline: reads file, splits into chunks, embeds with nomic-embed-text via Ollama, stores vectors in ChromaDB. Discloses that re-indexing is safe with old chunks replaced. No annotations to contradict; description adds substantial behavioral context.

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?

Extremely concise: two short paragraphs plus Args/Returns section. First sentence immediately communicates purpose. Every sentence adds value with no 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?

Covers purpose, process, parameter constraints, return value, and idempotency. Missing details on error handling or size limits, but output schema exists and tool is simple. Adequate for the context.

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?

Single parameter file_path has no schema description; the description adds absolute path requirement and lists supported file types (.pdf .md .txt .py .js .ts .json .yaml .yml), which is critical for correct invocation.

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?

Clearly states the tool indexes a document into a knowledge base for searchability. Distinguishes from siblings (delete_document, list_indexed_docs, search_docs) by focusing on adding content.

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 context: indexes for search, re-indexing is safe with automatic replacement. Lacks explicit when-not-to-use advice but is sufficiently clear given sibling tools.

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/Kamalesh-Kavin/rag-mcp'

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