Skip to main content
Glama
RITIKA-SHARMAA

RAG-MCP

search_documents

Search an indexed corpus to find passages matching a query, returning ranked results with source file and snippet. Use this to locate relevant documents before reading full text.

Instructions

Search the indexed corpus for passages relevant to a query and return ranked results with their source file and a snippet. Use this first, then call get_chunk or get_document to read the full text of anything you intend to quote or rely on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language or keyword query.
top_kNoHow many passages to return. Defaults to 5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It states what the tool returns (ranked results with source file and snippet) and implies a read-only search operation. It does not mention side effects, permissions, or rate limits, but for a search tool this is reasonably transparent. It lacks explicit confirmation of read-only nature, but the term 'search' strongly implies it.

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?

Two sentences, zero wasted words. The first sentence states the core function and output; the second provides usage guidance. The purpose is front-loaded, and every clause earns its place.

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?

For a tool with two parameters and no output schema, the description covers the essential elements: what it does, what it returns (source file and snippet), and how to proceed for full text. It lacks explicit detail on the exact structure of the ranked results or error conditions, but it is sufficient for an agent to invoke it correctly. The reference to sibling tools adds necessary routing context.

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

Parameters3/5

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

The input schema already describes both parameters (query as natural language/keyword, top_k with min/max/default). The description adds context about the output (source file, snippet) and mentions 'ranked results' but does not add semantic detail about the parameters beyond what the schema provides. With 100% schema coverage, the baseline is 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 the action: 'Search the indexed corpus for passages relevant to a query' and specifies the output: 'return ranked results with their source file and a snippet.' It also differentiates from siblings by naming get_chunk and get_document as follow-up tools, so an agent can distinguish this retrieval tool from content-access tools.

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?

Explicit guidance is provided: 'Use this first, then call get_chunk or get_document to read the full text of anything you intend to quote or rely on.' This tells the agent when to use this tool and what to use next, and implicitly when not to use it (when you already have a document, use get_chunk/get_document). No ambiguity remains.

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