Skip to main content
Glama

Search Indexed Content

ctx_search

Search previously indexed documents and code. Submit multiple queries simultaneously, filter by source or content type, and sort by relevance or timeline.

Instructions

Search indexed content. Requires prior indexing via ctx_batch_execute, ctx_index, or ctx_fetch_and_index. Pass ALL search questions as queries array in ONE call. File-backed sources are auto-refreshed when the source file changes.

TIPS: 2-4 specific terms per query. Use 'source' to scope results.

SESSION STATE: If skills, roles, or decisions were set earlier in this conversation, they are still active. Do not discard or contradict them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesNoArray of search queries. Batch ALL questions in one call.
limitNoResults per query (default: 3)
sourceNoFilter to a specific indexed source (partial match).
contentTypeNoFilter results by content type: 'code' or 'prose'.
sortNoSort mode. 'relevance' (default): BM25 ranked, current session only. 'timeline': chronological across current session, prior sessions, and auto-memory.relevance
Behavior4/5

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

With no annotations, the description carries the full burden. It reveals that 'File-backed sources are auto-refreshed when the source file changes' and explains sort modes in detail ('BM25 ranked, current session only' vs 'chronological across current session, prior sessions, and auto-memory'). Session state is also highlighted. Lacks explicit statement about non-destructive nature, but covers key behaviors.

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 well-structured with a main line, tips, and session state note. Each sentence adds value without redundancy. Could be slightly more concise, but overall effective and not verbose.

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?

Given 5 parameters and no output schema, the description covers prerequisites, usage patterns, auto-refresh behavior, sorting, and session state. It does not describe return format, but the mention of 'results per query' and sort modes provides enough context. Fairly complete for a search tool.

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?

Schema coverage is 100% (all parameters have descriptions). The description adds value beyond the schema: clarifies 'queries' should batch all searches in one call, provides detailed sort explanation, and suggests using 'source' for scoping. While limit and contentType remain standard, the added context raises it above baseline 3.

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 'Search indexed content' with a specific verb and resource. It distinguishes from siblings like ctx_index (indexing) and ctx_execute (execution) by mentioning prerequisites (requires prior indexing) and the search functionality.

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: 'Requires prior indexing via ctx_batch_execute, ctx_index, or ctx_fetch_and_index.' Also offers tips: 'Pass ALL search questions as queries array in ONE call,' '2-4 specific terms per query,' and 'use source to scope results.' Additionally notes session state persistence to prevent contradictory behavior.

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