Skip to main content
Glama
ESPChong

context-retrieval

by ESPChong

search_context

Retrieve top-k relevant chunks from indexed documents via semantic search, including source and page provenance. Optionally filter results to a specific document.

Instructions

Semantic search over indexed documents (FAISS + local embeddings). Returns the top-k chunks ranked by cosine similarity with source file and page provenance — feed these to your answer generation. Optional source_filter narrows hits to one document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
queryYes
source_filterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral disclosure burden. It explains the ranking methodology (cosine similarity), the output provenance (source file and page), and the effect of the optional filter, which gives a solid sense of expected behavior for a read-only search tool.

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 two sentences with no filler. The first sentence front-loads the core capability, output format, and ranking method, while the second adds the optional filter and downstream use. Every phrase earns its place.

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?

For a moderate-complexity tool with an output schema present, the description is complete: it states what the tool does, what it returns, how results are ordered, and the optional filter. It also gives a practical hint to feed results into answer generation, which covers the intended integration context adequately.

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 description coverage is 0%, so the description must compensate. It does: 'top-k' clarifies the k parameter's role, and source_filter is explicitly explained as narrowing hits to one document. The query parameter is left implicit, but its purpose is intuitively clear from the context.

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 the tool's function: semantic search over indexed documents using FAISS and local embeddings, returning top-k chunks with source file and page provenance. This distinguishes it from sibling tools like extract_document_text and index_document, which handle extraction and indexing rather than search.

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?

The description provides clear usage context: the returned chunks should be fed to answer generation, indicating it is the retrieval tool for grounding answers. It does not explicitly say when not to use it or compare directly to extract_document_text, but the intended use case is evident from the phrasing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/ESPChong/context-retrieval-system-RAG-MCP'

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