Skip to main content
Glama

ai_rag_answer

Read-only

RAG answer with verified citations — Bring your own documents (up to 250,000 characters) and a question: chunks the text, ranks passages offline with BM25, answers from the top passages with inline [n] citations, then verifies every citation offline (the passage exists and the quoted text is really in it). grounded=true only when all citations check out; if no passage matches, answers NOT in docs without a model call. docs= is text split by lines containing only --- or a JSON array of strings or {title,text}. Optional: k= passages (1-8), size= words per chunk. Nothing stored. Price: $0.012 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "q": "<q>",
      "docs": "<docs>"
    },
    "name": "ai_rag_answer"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYese.g. How long do refunds take?
docsYese.g. Refund policy: refunds are processed within 5 business days after approval. --- Shipping: orders ship in 3 to 7 days depending on region.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover readOnly/destructive/openWorld; the description adds real behavior: ranking is offline BM25 with no model call on miss, 'grounded=true only when all citations check out', nothing is stored, a 250,000-character input cap, and a concrete price ($0.012 USDC via x402). These are exactly the traits an agent needs before spending money or trusting the answer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and guarantee are front-loaded, and nearly every clause carries information. It is a single dense paragraph with heavy semicolon nesting, which makes the optional-parameter and pricing details slightly harder to scan than a short structured list would be.

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?

With no output schema, the description does explain the key return signal (grounded flag, inline citations, 'NOT in docs' fallback), which covers what an agent needs to act on results. It stops short of describing the full response payload (e.g., where citations or passage text are returned), a minor gap for a two-parameter tool.

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?

Schema labels for q and docs are only bare examples, and the description goes well beyond them by defining the docs grammar ('---' line separators, JSON array of strings, or {title,text}) plus two optional parameters (k=1-8, size=words per chunk) that do not even appear in the schema. This meaningfully compensates for what structured fields omit.

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 specific verb and resource ('RAG answer with verified citations') and immediately explains the full mechanism: chunking, offline BM25 ranking, inline [n] citations, and offline verification. This is enough detail for an agent to know this is the grounded-answer-over-my-own-docs tool rather than a generic chat or abstract tool.

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?

Use conditions are clear from the opening clause ('Bring your own documents ... and a question') and the docs format spec tells the caller exactly what input shape is required. It also states the failure path ('if no passage matches, answers NOT in docs without a model call'), but offers no explicit when-to-prefer-this-over-a-sibling guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources