Skip to main content
Glama

get_document

Read-onlyIdempotent

Retrieve a document’s text or a specific section. Paginate long content to read complete, grounded information from local Markdown, text, or PDF files.

Instructions

Retrieve the text of a document, or of one section of it. Long content is paginated: if truncated is true, call again with offset=next_offset.

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

Input Schema

NameRequiredDescriptionDefault
doc_idYesdoc_id from search_docs or list_documents
offsetNoCharacter offset for paging through long content
sectionNoOptional section heading (or 'Page 3' for PDFs) to return only that part. Case-insensitive; partial matches allowed.
max_charsNoMaximum characters to return

Output Schema

NameRequiredDescriptionDefault
titleYes
doc_idYes
offsetYes
contentYes
sectionYesSection returned, or null for the whole document
truncatedYes
next_offsetYesPass as `offset` to read the next part
total_charsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description adds genuinely new behavior — long content is paginated and signalled via `truncated`/`next_offset`, which are response fields not present in the input schema. It says nothing about error behavior for a bad doc_id or missing section, which is a real gap for a retrieval tool.

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, both front-loaded: the core operation first, then the paging loop. Nothing is repeated from the schema or annotations and no sentence is filler.

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 values need not be spelled out, and the description covers the one behavior an agent must get right — continuing pagination. It is nearly complete for this complexity, missing only how section and offset interact and what happens on an unresolvable doc_id.

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 coverage is 100%, including the note that doc_id comes from search_docs or list_documents and that section matching is case-insensitive with partial matches, so the schema does the heavy lifting. The description only adds the relationship between offset and the returned next_offset, which is a modest increment over the baseline.

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 specific verb and resource ("Retrieve the text of a document, or of one section of it") and makes the section-vs-whole-document distinction explicit. It does not name its siblings search_docs or list_documents, so the agent must infer that this is the fetch step after discovery, but the operation itself is unambiguous.

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?

It gives clear context for use: read a whole document or one section of it, and what to do when the response is truncated (call again with offset=next_offset). It stops short of explicit exclusions such as "use search_docs to find a doc_id first," leaving that routing to the schema's doc_id description.

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