Skip to main content
Glama

Answer a question from a document (AI)

answer_from_document
Read-only

Answer a question grounded ONLY in a source document — a web page, PDF, Office file, or raw text. Provide 'question' plus ONE source: 'url', 'pdf', 'file' (base64), or 'text'. Says so when the answer isn't in the document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdfNoA file_id from a prior tool, or a base64-encoded PDF.
urlNoA public http/https URL to read.
fileNoA base64-encoded .docx, .xlsx or .csv file.
textNoRaw text to answer from directly.
questionYesThe question to answer from the document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already mark this as read-only and open-world. The description adds valuable behavioral context: answers are grounded only in the provided source, and the tool explicitly reports when the answer is absent. No contradiction with annotations.

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 tight sentences with no filler. The purpose is front-loaded, followed by the input rule and the key behavioral caveat. 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?

Covers all essential information an agent needs: what it does, accepted source types, the one-source requirement, and the behavior when the answer is missing. Output format is not described, but no output schema exists and the return is self-evident from 'Answer a question'.

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?

Schema coverage is 100%, so each parameter is already documented. The description adds the critical 'ONE source' exclusivity constraint, which is not encoded in the schema, and clarifies that pdf can be an id or base64.

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?

States a specific verb and resource: 'Answer a question grounded ONLY in a source document' with enumerated source types. The 'grounded ONLY' phrasing differentiates it from extraction, summarization, and scraping siblings.

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?

Gives a clear usage pattern: provide 'question' plus exactly ONE source selected from url, pdf, file, or text. It also states the tool will say when the answer isn't in the document. It does not name sibling alternatives explicitly, but the input contract is unambiguous.

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