Skip to main content
Glama

Read a document

get_document
Read-only

Read the full text of one uploaded document of a knowledge base, in order, about 30 passages per call. Use it when a search result is relevant but you need more context. Acts of law are not documents and are read by provision. Pass the kb address and the work_id; an answer with next_offset continues from that offset. A page counts as several searches against the user's plan (one per default number of search results), and some knowledge bases allow search only.

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

Input Schema

NameRequiredDescriptionDefault
kbYesAddress of the knowledge base, "owner/name", from list_knowledge_bases.
offsetNoPassage to start from.
work_idYesThe document's work_id (unit.work_id in search results, or list_sources).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover safety (readOnlyHint, destructiveHint=false), and the description adds context annotations cannot: roughly 30 passages returned per call, continuation via next_offset, and a cost model ('a page counts as several searches against the user's plan'). The availability caveat for search-only knowledge bases is exactly the kind of behavioral risk an agent needs.

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 the core read semantics, then routing, then pagination, then cost — a sensible order with no filler. The parenthetical on cost ('one per default number of search results') is slightly dense, but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description still explains the shape of the response via next_offset and the pagination contract, plus the unit of measure (passages). Combined with full parameter documentation, an agent has everything needed to call and continue correctly.

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; the description adds real meaning by tying offset to continuation ('an answer with next_offset continues from that offset') and naming where work_id comes from. It stops short of covering any edge cases such as offset beyond the document end.

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 ('Read the full text of one uploaded document'), the unit of return ('in order, about 30 passages per call'), and explicitly separates itself from the provision reader ('Acts of law are not documents and are read by provision'). An agent can distinguish it from get_provision and search_knowledge without opening a 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 a positive trigger ('when a search result is relevant but you need more context') and an explicit exclusion with the correct alternative for legal acts. It also flags the constraint that 'some knowledge bases allow search only', which prevents futile calls.

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.