Skip to main content
Glama

Docs Read Document

docs_read_document
Read-onlyIdempotent

Read a Google Docs document across all tabs as text, markdown, editing outline, or raw resource to summarize content or retrieve indices for batch updates.

Instructions

Read a Google Docs document, every tab in order: 'text' or 'markdown' to read or summarize it, 'outline' for the indices docs_batch_update_document (extended tool tier) needs, 'raw' for Google's Document resource unchanged. Every format returns document_id, title, url and revision_id (null unless the user can edit the document). Text and markdown add format, tabs and one page of body with truncated, next_offset, body_chars and body_sha256; outline adds tabs of content elements (kind, start_index, end_index, text, style) with truncated, next_offset, element_count, outline_chars and outline_sha256; page on with offset=next_offset until it is null. Raw returns the resource in document.

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_id": "<document_id>"
    },
    "name": "docs_read_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
formatNoOutput form: 'text' returns clean readable text; 'markdown' the same content as Markdown (headings, lists, pipe tables, links, footnotes); both come in pages of about 8,000 characters. 'outline' returns the editing outline in pages of about 16,000 characters of JSON, cut only between structural elements: every element with the start_index and end_index docs_batch_update_document (extended tool tier) requests need, styles left out; an index inside an element's text counts UTF-16 units, so most emoji take two; a tab begun on an earlier page has continued true and no headers, footers, footnotes or named_ranges. 'raw' returns Google's Document resource unchanged and unpaged, every style and index included. The text differs from drive_read_file's Google export, so body_chars differ too.text
offsetNoWhere to resume: the next_offset of a truncated result, with the same format. For 'text' and 'markdown' a character offset into the rendered text; for 'outline' the number of structural elements already read, counted across tabs in order. 0 starts at the beginning; 'raw' ignores it.
document_idYesGoogle Docs document ID: the Drive file ID, also the long ID in the document's URL, from drive_list_files, search_workspace or docs_create_document.
include_tabs_contentNoRead every tab, child tabs included, in every format (the default). When false Google returns only the first tab, so tabs then holds one entry whose tab_id and title are null.
suggestions_view_modeNoHow pending suggested edits appear, in every format: SUGGESTIONS_INLINE marks them inline (text and markdown leave suggested insertions out), PREVIEW_SUGGESTIONS_ACCEPTED shows the text as if all were accepted, PREVIEW_WITHOUT_SUGGESTIONS as if all were rejected. Omitted or DEFAULT_FOR_CURRENT_ACCESS: inline for editors, without suggestions for viewers.

Output Schema

NameRequiredDescriptionDefault
urlNo
bodyNo
tabsNo
titleNo
formatNo
documentNo
truncatedNo
body_charsNo
body_sha256No
document_idNo
next_offsetNo
revision_idNo
element_countNo
outline_charsNo
outline_sha256No
suggestions_view_modeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered; the description still adds real behavior: revision_id is null unless the user can edit, outline pages cut only between structural elements with continued tabs lacking headers/footers/footnotes, and include_tabs_content=false collapses tabs to one null-id entry. What it does not do is state error behavior (missing doc, no permission) or what truncation looks like on 'raw' beyond 'unpaged'.

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?

Purpose and mode selection are front-loaded, and nearly every clause carries information about return shape or pagination. It is, however, one long semicolon-chained paragraph in which the per-format return-field discussion compresses four modes into a dense block that is harder to scan than it needs to be.

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 an output schema present, the description correctly avoids re-explaining return values in prose yet still names the shared fields (document_id, title, url, revision_id) and the per-format paging fields an agent must handle. Given annotations, full schema coverage and five parameters, nothing material is missing for correct invocation, including the offset resumption rule.

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 description coverage is 100% and the schema text already explains format, offset units, include_tabs_content and suggestions_view_mode in depth, so the description's parameter content largely restates structured data. It adds a little by tying offset to the truncated/next_offset loop and by noting the UTF-16 index caveat, but the heavy lifting is the schema's.

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?

Opens with a specific verb and resource ('Read a Google Docs document, every tab in order') and then enumerates the four output modes, so an agent knows exactly what it gets. It also explicitly contrasts its text with drive_read_file's Google export, which separates it from the nearest sibling.

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 per-mode selection guidance: 'text' or 'markdown' to read or summarize, 'outline' for the indices docs_batch_update_document needs, 'raw' for the unchanged resource. It also states the paging loop ('page on with offset=next_offset until it is null'). It stops short of naming exclusions, e.g. when to prefer drive_read_file or slides/sheets readers instead.

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