Skip to main content
Glama

Get document structure

get_document
Read-onlyIdempotent

Retrieve the complete raw Google Docs structure, including element indexes, styles, tables, and headers, to provide the exact map for range-based edits.

Instructions

Returns the raw Docs API document: title, documentId, revisionId, per-tab body with every structural element's startIndex/endIndex, textRun styles, tables, lists, inlineObjects (image ids for replace_image), headers/footers (their segment ids) and named styles. This is the exact index map that range tools consume, but it is VERBOSE — for reading content prefer read_document_text, which returns compact blocks with the same indexes. include_tabs_content=true (default) populates all tabs; suggestions_view_mode controls how unresolved suggestions render (default DEFAULT_FOR_CURRENT_ACCESS).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
include_tabs_contentNoPopulate every tab's content (default true). false = first-tab legacy shape.
suggestions_view_modeNoHow unresolved suggested edits render in the returned content.
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral context beyond that: it warns that the output is 'VERBOSE,' reveals the default behavior of include_tabs_content, and explains how suggestions_view_mode changes rendering. This gives the agent realistic expectations about payload size and output shape.

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?

The description is dense but efficiently structured: first the return payload, then the critical verbosity warning and sibling routing, then the parameter defaults. Every clause adds information, though the long em-dash sentence packs many items together and is slightly harder to parse than a short list would be.

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 must carry the burden of explaining return values, and it does so in useful detail: field names, index semantics, tabs, headers/footers segment ids, and image ids for replace_image. It also signals the relationship to range tools. Minor gaps remain, such as not describing error conditions or how large the payload can be beyond 'VERBOSE,' but it is complete enough for an agent to call the tool and interpret the result.

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 description coverage is 100%, so the baseline is 3. The description adds extra value by restating the defaults ('include_tabs_content=true (default)', 'suggestions_view_mode ... DEFAULT_FOR_CURRENT_ACCESS') and by explaining the semantic consequence of false for include_tabs_content ('first-tab legacy shape'). That is meaningful beyond the schema's field-level descriptions.

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?

The description states a specific verb ('Returns') and a precise resource ('the raw Docs API document'), then enumerates exactly what that includes: title, documentId, revisionId, per-tab body, indexes, styles, tables, lists, inlineObjects, headers/footers, and named styles. It also differentiates itself from the sibling read_document_text by labeling itself as the verbose, index-map-producing variant, so an agent can tell them apart without inspecting schemas.

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?

The description gives explicit when-to-use guidance: this tool is 'the exact index map that range tools consume,' meaning it should be selected when structural indexes are needed. It also names the alternative directly: 'for reading content prefer read_document_text, which returns compact blocks with the same indexes.' This is clear, actionable sibling routing.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-docs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server