Skip to main content
Glama

search_context

Search documents and retrieve results with adjacent context chunks to provide full context for accurate answers.

Instructions

Search with parent/sibling/child context expansion.

For each result, includes surrounding chunks (context_chunks before and after) so the LLM has full context.

Args: query: Natural language query. k: Number of primary results (max 20). context_chunks: Number of adjacent chunks to include (0-5). source_type: Optional filter: "code", "markdown", or "text".

Returns: List of results, each with a "context" field containing surrounding chunks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
queryYes
source_typeNo
context_chunksNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations exist, so description carries full burden. It describes the return format and context behavior, but doesn't disclose potential side effects or safety/permission requirements. As a search tool, it's likely safe, but transparency is incomplete.

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 brief intro followed by clear Args and Returns sections. It is appropriately sized and front-loaded with the core purpose, though some sentences could be slightly tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 4 params and no annotations, the description covers the tool's purpose, parameters, and return format adequately. However, it lacks explicit usage guidelines and differentiation from sibling search tools, and doesn't specify edge cases or behavior under failure.

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?

With 0% schema description coverage, the description adds crucial meaning: defines query as natural language, k with maximum 20, context_chunks with range 0-5, and source_type with three filter options. This compensates well for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it performs search with parent/sibling/child context expansion, and lists parameters. It mostly distinguishes from basic search but doesn't explicitly differentiate from other search siblings like search_similar or retrieve_context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It implies use when needing full context around results, but does not mention when not to use it or provide alternatives among siblings like search, search_graph, or search_similar.

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/moliver28/corpus-kb'

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