Skip to main content
Glama
chetan1521

grounded-rag-mcp

by chetan1521

answer

Retrieve relevant passages and generate cited responses grounded solely in your documents, refusing when no supporting evidence exists.

Instructions

Answer a question grounded in a collection, with citations. Retrieves relevant passages and asks the host's model (via MCP sampling) to answer using only those, citing them. Refuses (grounded=false) when nothing relevant is found.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topKNo
queryYes
collectionNodefault

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 burden, and it does well: it discloses that the tool delegates to the host model via MCP sampling, restricts the answer to retrieved passages only, includes citations, and returns grounded=false when nothing relevant is found. It lacks details about response shape or error behavior, but the core behavioral traits are clearly stated.

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?

Three sentences, front-loaded with the primary purpose, and every sentence adds meaningful behavioral information. No filler or repetition of schema content.

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 of moderate complexity with no annotations and no output schema, the description covers the main invocation-relevant behaviors: retrieval, generation, citation, and refusal. It stops short of detailing the exact return structure of grounded=false or citation formatting, but an agent can invoke the tool correctly with the information provided.

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

Parameters2/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 for parameter meaning. It implicitly relates 'question' to query and 'collection' to the collection parameter, and 'retrieves relevant passages' hints at topK, but it never explicitly explains topK or the meaning of the defaults. The description adds some context but not enough to fully clarify all three parameters.

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 names a clear verb-resource pair ('Answer a question grounded in a collection') and adds differentiators: citations, retrieval, MCP sampling, and refusal. This clearly separates it from siblings like search or list_collections.

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?

It clearly implies when to use the tool: when the agent needs a grounded, cited answer synthesized from relevant passages in a collection. It does not explicitly name alternatives or exclusions like 'use search for raw passages', but the contextual phrasing is strong enough that an agent can infer the appropriate use.

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