Skip to main content
Glama

Read a project document

get_doc
Read-onlyIdempotent

Read consecutive passages of an indexed document: the passage numbered chunk (a search_docs result's chunk) plus before and after passages either side (default 1 each, max 10). Use it when a search hit is cut off mid-clause, refers to another clause, or uses a defined term you need to read. Returns { document: { document_reference, title, filename, pages, chunk_count, status, … }, from, to, chunks: [{ chunk, page, section, text }] }. chunk 0 with a larger after reads a document from the start. A document that isn't indexed yet is a tool error. Nothing is changed.

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": {
      "document_reference": "<document_reference>"
    },
    "name": "get_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNoOptional. Passages after it to include, default 1.
chunkNoOptional. The passage to read around: a search_docs result's chunk. Default 0 (the start).
beforeNoOptional. Passages before it to include, default 1.
document_referenceYesThe document, from a search_docs result or get_project's documents.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover read-only/idempotent/no-open-world, and the description reinforces that with 'Nothing is changed'. Beyond annotations it adds two genuinely useful behaviors: the exact return envelope (`document`, `from`/`to`, `chunks`) and that an unindexed document surfaces as a tool error rather than an empty result.

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 action, then usage triggers, then return shape, then edge cases — a logical order with little waste. The inline return-type listing is long, but it is justified since no output schema exists; only minor tightening is possible.

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?

With four parameters, no output schema, and a sibling it must be sequenced after, the description covers everything needed to call it correctly: defaults, caps, the chunk-0 idiom, the return shape, and the not-indexed error case. No meaningful gap remains.

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 meaning: `chunk` is defined relative to a search_docs hit, `before`/`after` are described as passages 'either side' with defaults 1 and max 10, and the chunk-0 pattern shows how the parameters combine. That compositional insight is not in the schema.

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 consecutive passages of an indexed document' — and immediately pins the scope to the `chunk` from a search_docs result plus surrounding `before`/`after` passages. That framing makes it distinguishable from search_docs and get_docs without opening either 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 concrete selection criteria — a search hit cut off mid-clause, a cross-reference to another clause, or an unfamiliar defined term — and adds the chunk-0-with-larger-after idiom for reading from the start. It effectively tells the agent to come here after a search hit rather than re-searching.

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