Skip to main content
Glama

Index Content

ctx_index

Store content into a searchable knowledge base, splitting markdown by headings and preserving code blocks, so you can retrieve exact chunks via ctx_search without inflating context.

Instructions

Store content in a searchable knowledge base (BM25 over FTS5). Splits markdown by headings, keeps code blocks intact, and persists the raw chunks. The full content stays in storage — retrieve any section on-demand via ctx_search; nothing is summarized or truncated.

WHEN:

  • 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 to keep verbatim in conversation

  • README files, migration guides, changelog entries

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

WHEN NOT:

  • Log files, test output, CSV, or build output — use ctx_execute_file, which processes in-sandbox without persisting bytes

  • Single-use ephemeral content you will not query later — keep it inline if it fits, or ctx_execute_file it

RETURNS: Indexing metadata: chunk counts (total, code-bearing), source label, and the exact ctx_search call shape to query the indexed content. Raw content is NOT echoed back — it lives in storage, retrievable via ctx_search(source: ""). When path is provided, a content hash is stored so ctx_search results auto-flag staleness on future calls.

EXAMPLE: ctx_index(content: "# React useEffect\n\nThe Effect Hook lets you ...", source: "react-useeffect-docs") EXAMPLE: ctx_index(path: "/path/to/large-spec.md", source: "openapi-v2-spec")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoFile OR directory path to read and index (content never enters context). Provide this OR content. Directory paths trigger a bounded recursive walk (#687).
sourceNoLabel for the indexed content (e.g., 'Context7: React useEffect', 'Skill: frontend-design')
contentNoRaw text/markdown to index. Provide this OR path, not both.
excludeNoDirectory-only: glob patterns to exclude. Merged with defaults (node_modules, .git, dist, build, .next, coverage, .venv, __pycache__, .DS_Store).
includeNoDirectory-only: glob patterns to include (default: all matching extensions).
maxDepthNoDirectory-only: max recursion depth from root (default: 5).
maxFilesNoDirectory-only: hard cap on files indexed (default: 200) — FTS5 blow-up guard.
extensionsNoDirectory-only: allowed file extensions (default: .md .mdx .txt .json .yaml .yml .ts .tsx .js .jsx .py .rs .go .sh).
followSymlinksNoDirectory-only: follow directory symlinks (default: false — cycle hazard + escape risk).
respectGitignoreNoDirectory-only: apply nearest .gitignore (default: true).
Behavior5/5

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

Beyond the four annotation hints, the description discloses meaningful behavior: content is not summarized or truncated, raw chunks persist in storage, and returned metadata excludes raw content. It also explains that when path is provided a content hash enables staleness detection, and that directory indexing is a bounded recursive walk.

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 front-loaded with a two-sentence summary of the tool's essence, followed by clearly labeled WHEN/WHEN NOT/RETURNS/EXAMPLE sections. Each section adds unique information without filler, making the length justified by the tool's complexity.

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?

No output schema exists, so the description compensates by explicitly stating RETURNS: chunk counts, source label, and the exact ctx_search call shape. It also covers edge cases like path-vs-content, directory walking bounds, and staleness flags, making the description self-sufficient.

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?

Input schema covers all 10 parameters with detailed descriptions (100% coverage), so the baseline is 3. The description adds context by clarifying that content never enters context when using path and that path triggers hash-based staleness detection, plus two concrete examples showing how to call the tool.

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 and resource: 'Store content in a searchable knowledge base (BM25 over FTS5).' It clearly distinguishes itself from siblings by specifying it splits markdown by headings, preserves code blocks, and stores raw chunks for later retrieval, with the explicit contrast to ctx_execute_file in WHEN NOT.

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?

The WHEN section enumerates concrete use cases (Context7 docs, API references, MCP tool lists, skill prompts) and the WHEN NOT section explicitly excludes log files/test output and directs to ctx_execute_file. It also names ctx_search as the retrieval counterpart, giving clear decision criteria.

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

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