Skip to main content
Glama

get_document

Read-onlyIdempotent

Retrieve a document's full text by ID or path, or up to 50 documents' with 'files'. Returns extracted text for binary formats (PDF, DOCX, PPTX).

Instructions

Retrieve a document's full text by ID or path, or up to 50 documents' with 'files'. Returns extracted text for binary formats (PDF, DOCX, PPTX). Intended for use after search_knowledge returns a DocumentId worth reading in entirety, or when the user has named an exact file. With 'files' each document comes under its own header in the order asked; a file that can't be read gets an error line and doesn't stop the others, and past 2,000,000 characters in all, the rest get one too. Pair 'files' with list_files sort "newest" and limit to read the newest entries of a folder in two calls.

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": {
      "containerId": "<containerId>"
    },
    "name": "get_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoSeveral documents instead of one: JSON array of document IDs (UUID) or virtual paths, e.g. ["/log/2026-11-08.md","id2"]. Max 50. Use instead of fileId.
fileIdNoDocument ID (UUID) or virtual path (e.g., '/docs/readme.md')
containerIdYesContainer ID or name

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.4.2
    • addedInput schema / properties / fileId / default
      Added value: +null
    • changedInput schema / properties / fileId / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedInput schema / properties / files
      Added value: +{
      +  "default": null,
      +  "description": "Several documents instead of one: JSON array of document IDs (UUID) or virtual paths, e.g. [\"/log/2026-11-08.md\",\"id2\"]. Max 50. Use instead of fileId.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / required
      Previous value: -[
      -  "containerId",
      -  "fileId"
      -]New value: +[
      +  "containerId"
      +]
  2. First observedv0.3.2

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnly and idempotent; the description adds a lot beyond them: text extraction for binary formats, per-document headers in requested order, per-file error isolation that does not abort the batch, and a 2,000,000-character aggregate truncation rule. These are exactly the behaviors an agent needs to reason about partial failures and size limits.

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-loaded with purpose, then usage, then behavior — a sensible order with no filler sentences. Slightly marred by awkward phrasing and a stray apostrophe ('documents' with 'files'') and by packing error/truncation rules into one run-on clause.

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 carries the burden of describing returns and does so (extracted text, per-file headers, error lines, truncation). Remaining gaps are minor: it does not say how a single-fileId failure or an unsupported format behaves, nor clarify what containerId accepts beyond the schema.

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 the baseline is 3, but the description adds real semantics: 'files' returns documents in the order asked with per-document headers, and a rejected entry produces an error line rather than failing the batch. That meaning goes beyond the schema's 'JSON array... Max 50' note.

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 ('Retrieve a document's full text') plus the two access modes (single ID/path vs. up to 50 via 'files') and the formats handled (PDF, DOCX, PPTX). An agent can distinguish this from list_files and search_knowledge without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use conditions: after search_knowledge yields a DocumentId worth reading in full, or when the user names an exact file. It also names a concrete two-call workflow with list_files sort "newest" plus limit for reading a folder's newest entries, which routes the agent to the right sibling.

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