Skip to main content
Glama

rag_answer

Read-onlyIdempotent

Answers questions grounded in your documents and returns cited answers; without an API key, returns ranked passages to answer from.

Instructions

Answer a question grounded in the documents, with citations.

With ANTHROPIC_API_KEY set, returns a synthesized cited answer; otherwise returns the ranked passages for you to answer from.

Examples: - "Summarize the cancellation terms" -> query='cancellation terms' - "Does the plan include support?" -> query='support included in plan'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description adds genuinely new behavioral context: output varies by environment (synthesized cited answer vs. raw ranked passages), which the structured fields do not convey. It says nothing about the retrieval scope or latency, but the mode-switching disclosure is the important part.

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?

Front-loads the core purpose in the first clause, then adds the mode caveat and two short examples. Every element is functionally useful, though the second sentence could be tightened slightly.

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?

An output schema exists, so return format need not be explained, yet the description still usefully distinguishes the two response shapes. Combined with the parameter schema and annotations, an agent has enough to invoke this correctly; only the sibling relationship to rag_search is left unresolved.

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

Parameters4/5

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

The examples demonstrate how to phrase the `query` argument from a user question, which is real added meaning beyond the schema's field description. However `k` and `response_format` are never mentioned in the description, so those rely entirely on the nested schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a precise verb+resource+output: answers a question grounded in the provided documents and includes citations. It also clarifies the two possible outputs (synthesized answer vs. ranked passages). It does not name or differentiate from siblings like rag_search, which it partially overlaps with when synthesis is unavailable.

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?

Explains the condition that selects each mode (ANTHROPIC_API_KEY present vs. absent) and provides worked examples showing how a natural-language question maps to the `query` value. It gives no explicit guidance on when to prefer this over rag_search, leaving the sibling boundary to inference.

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

Deploy Server

Other Tools