Skip to main content
Glama

Answer from documentation (RAG)

answer_question
Read-only

Answers questions directly from local Markdown docs by retrieving the top-k relevant sections and returning numbered citations, grounding responses in exact documentation instead of model memory.

Instructions

Retrieve the top-k sections for a question and answer with numbered citations. Uses MCP sampling when the client supports it; otherwise returns the grounded context for the caller's model.

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": {
      "question": "<question>"
    },
    "name": "answer_question"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNo
questionYes

Output Schema

NameRequiredDescriptionDefault
modeYes
answerYes
contextYes
citationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description carries most of the behavioral burden and does it well by disclosing the dual execution mode: MCP sampling when the client supports it, otherwise returning grounded context for the caller's model. That is material to how the agent handles the response. It does not mention behavior when no relevant sections are found or how citations are numbered.

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?

Two sentences with zero waste; the core purpose is front-loaded and the execution-mode caveat follows in a single compact clause. Every sentence earns its place.

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-value explanation is not required, and the description still adds the useful dual-mode note. For a two-parameter tool this is close to complete, with only empty-result behavior and k's bounds left unstated.

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 0%, so the description must compensate. It explains k as the number of top sections retrieved, which is the non-obvious parameter, and 'question' is self-evident. However, it omits the documented bounds (1-8, default 4) and the question length constraint, leaving some schema detail uncontextualized.

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?

The description uses a concrete verb-plus-resource formulation ('retrieve the top-k sections for a question and answer with numbered citations'), so the agent knows this both retrieves and generates a cited answer, unlike a plain search. It does not name a sibling to differentiate against, but the retrieve-and-answer scope is specific enough to separate it from list_documents or read_section.

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?

Usage is implied: this is the tool for answering a natural-language question from the docs. There is no explicit when-to-use versus when-not, and no guidance on choosing it over search_docs for retrieval-only needs, so the agent must infer the selection rule.

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