Skip to main content
Glama

Index Content

ctx_index

Index documentation or knowledge content into a searchable BM25 knowledge base. Chunks markdown by headings, storing only a brief summary to preserve LLM context. Retrieve specific sections on demand using search.

Instructions

Index documentation or knowledge content into a searchable BM25 knowledge base. Chunks markdown by headings (keeping code blocks intact) and stores in ephemeral FTS5 database. The full content does NOT stay in context — only a brief summary is returned.

WHEN TO USE:

  • Documentation from Context7, Skills, or MCP tools (API docs, framework guides, code examples)

  • API references (endpoint details, parameter specs, response schemas)

  • MCP tools/list output (exact tool signatures and descriptions)

  • Skill prompts and instructions that are too large for context

  • README files, migration guides, changelog entries

  • Any content with code examples you may need to reference precisely

After indexing, use 'ctx_search' to retrieve specific sections on-demand. When path is provided, a content hash is stored for automatic stale detection in search results. Do NOT use for: log files, test output, CSV, build output — use 'ctx_execute_file' for those.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentNoRaw text/markdown to index. Provide this OR path, not both.
pathNoFile path to read and index (content never enters context). Provide this OR content.
sourceNoLabel for the indexed content (e.g., 'Context7: React useEffect', 'Skill: frontend-design')
Behavior5/5

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

Even without annotations, the description discloses key behaviors: content is chunked by headings, stored in ephemeral FTS5, only a summary is returned, and path enables stale detection. No contradictions with missing annotations.

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 longer than average but well-organized with clear sections. Front-loads the core purpose and then provides structured guidance. Could be slightly trimmed but earns its sentences.

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?

Despite no output schema, the description explains what is returned (brief summary) and how the tool works internally (chunking, storage, stale detection). This is complete for a content-indexing tool with 3 parameters.

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

Parameters4/5

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

Although input schema has 100% coverage on parameter descriptions, the description adds useful context: mutual exclusivity of content and path, that path content never enters context, and example labels for source. This enhances the schema information.

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 ('Index') and resource ('documentation or knowledge content'), clearly stating the tool's purpose. It distinguishes itself from siblings like ctx_search and ctx_execute_file by specifying content types and behavior.

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' and 'Do NOT use for' sections, listing appropriate content types and alternatives. Also suggests using ctx_search after indexing, giving clear guidance on tool selection.

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/mksglu/context-mode'

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