Skip to main content
Glama
damoqiongqiu

mcp-local-rag

by damoqiongqiu

query_documents

Find relevant content in ingested documents by combining keyword and semantic search, returning ranked results with file paths, scores, and context.

Instructions

Search ingested documents with hybrid keyword + semantic matching. Returns results sorted by relevance, each with filePath, chunkIndex, text, fileTitle, score (0 = best, higher = worse), and source (for ingest_data items).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results (default 10, range 1-20). Lower favors precision, higher recall.
queryYesSearch query. Preserve specific user terms (for keyword match); add context when the query is vague (for semantic match).
scopeNoOptional absolute path prefix(es) — one string or a list (unioned) — restricting results to a filePath equal to or under a prefix. "/docs/api" matches "/docs/api/auth.md" but not "/docs/apiv2". Must be absolute (server OS style); a relative prefix matches nothing — derive one from a filePath returned by an earlier query, or omit scope.
instanceNoInstance name to search. Use "*" for all instances. Required when multiple instances are configured.
searchModeNoSearch mode preset. "exact" (hybridWeight=0.8) for identifiers and symbols, "code" (0.5) for balanced code understanding, "doc" (0.3) for broad semantic search. Overrides per-instance hybridWeight defaults.
fromTimestampNoOptional ISO 8601 timestamp — only return chunks ingested on or after this time. Example: "2026-07-01T00:00:00Z".
untilTimestampNoOptional ISO 8601 timestamp — only return chunks ingested on or before this time. Example: "2026-07-10T23:59:59Z".
highlightContextNoCharacters of surrounding context around each query-term match in the returned chunks (default 0 = no highlight). When > 0, results include a "matchContext" array with highlighted snippets.
Behavior4/5

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

With no annotations, the description carries the burden of disclosing behavior. It adds value by specifying the return shape (filePath, chunkIndex, text, fileTitle, score) and clarifying score semantics (0 = best, higher = worse) and the source field for ingest_data items. It does not discuss errors or permissions, but for a read-only search tool, this is sufficient.

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 concise sentences: the first states the action, the second lists the result fields and score behavior. Every word earns its place, with no redundancy or filler.

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?

Despite having 8 parameters and no output schema, the description covers the key missing piece—the return value structure—along with the non-obvious score ordering. The schema already provides exhaustive parameter details, so the description plus schema form a complete picture for an agent to invoke this tool correctly.

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?

Schema description coverage is 100%, so the baseline is 3. The description does not elaborate on individual parameters; it only mentions hybrid matching, which is already reflected in searchMode. Since the schema fully documents all parameters, the description adds no extra semantic value for params, but it does not need to.

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 opens with a specific verb and resource: 'Search ingested documents with hybrid keyword + semantic matching.' It clearly distinguishes this tool from siblings like delete_file, ingest_file, and list_files, and even from find_definition/find_references by emphasizing general hybrid search rather than specific symbol lookup.

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?

The description states the tool's core function and that it returns relevance-sorted results, giving implied context for when to use it. However, it does not explicitly contrast it with siblings such as find_definition or find_references, nor does it state when to prefer one over another, so usage guidance remains implicit rather than 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/damoqiongqiu/mcp-local-rag'

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