Skip to main content
Glama

search_docs

Search indexed local documents by semantic similarity. Submit a natural-language query to retrieve relevant text chunks from your knowledge base.

Instructions

Semantically search the knowledge base for content related to query.

The query is embedded using the same model used during indexing. ChromaDB finds the N most similar chunks using cosine similarity. Lower distance = more relevant.

Args: query: Natural-language question or keyword phrase. n_results: How many results to return (default 5, max 20). source_filter: If non-empty, restrict search to chunks from this specific document (exact filename, e.g. "notes.md").

Returns: Formatted string with matching chunks, their sources, and distances. Returns a helpful message if the knowledge base is empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
n_resultsNo
source_filterNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, but description discloses internal mechanism (embedding, cosine similarity, lower distance = more relevant) and return format (chunks, sources, distances, empty KB message). Missing details on side effects or auth, but as a read-only tool, transparency is nearly complete.

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?

Description is concise and well-structured: first line states purpose, followed by explanation, then parameter descriptions, finally return info. No unnecessary words, front-loaded with key information.

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?

Given 3 parameters, no nested objects, and presence of output schema (though not shown), description covers all necessary aspects: how search works, parameter details, return format, and edge case (empty KB). No gaps identified.

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

Parameters5/5

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

Description adds meaning beyond schema: `n_results` is explained with default 5 and max 20 (not in schema), `source_filter` specifies exact filename, `query` described as natural-language or keyword. Schema coverage is 0%, so description fully compensates.

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 'Semantically search the knowledge base for content related to `query`.' The verb 'search' and resource 'knowledge base' are specific, and the tool is distinct from sibling tools (delete, index, list). Explanation of embedding and cosine similarity reinforces purpose.

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?

Description implies use for retrieval, but lacks explicit guidance on when to use vs. alternatives like exact-match search. Sibling tools have clearly different purposes, so context is sufficient but not explicit.

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/Kamalesh-Kavin/rag-mcp'

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