Skip to main content
Glama

Export a document

export_document

Export a Google Doc to Markdown, TXT, HTML, PDF, DOCX, ODT, RTF, or EPUB. Text formats return inline; binary formats save to a local file via output_path.

Instructions

Exports the document via Drive. Text formats (markdown, txt, html) are returned inline as the tool result — format=markdown is the way to read a doc as Markdown for a round trip with import_markdown. Binary formats (pdf, docx, odt, rtf, epub) require output_path and are written to that local file (the result reports saved_to and bytes); output_path also works for text formats. output_path must be absolute, and an existing file is never overwritten unless overwrite=true. Exports are capped at 10 MB by the Drive API; comments and suggestions are not part of any export. Nothing in Google Docs changes; the only side effect is the local file when output_path is set.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatYesTarget format; markdown/txt/html can be returned inline, the rest need output_path.
overwriteNoAllow output_path to replace an existing file (default false).
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
output_pathNoAbsolute local file path to write the export to (required for binary formats). Refused if the file already exists, unless overwrite=true.
Behavior5/5

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

The description goes well beyond the annotations by disclosing that Google Docs content is never modified, the only side effect is a local file when output_path is set, existing files are never overwritten unless overwrite=true, exports are capped at 10 MB, and comments/suggestions are excluded. It also describes the result contents (saved_to and bytes for binary exports), giving the agent a strong model of the tool's behavior.

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?

The description is dense but every sentence earns its place: format categories, the markdown use case, output_path behavior, overwrite rules, API limits, and side effects. It is front-loaded with the core purpose and then branches logically into format-specific details without any fluff.

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?

For a tool with no output schema, the description is remarkably complete: it covers return behavior for text formats, file-writing behavior for binary formats, overwrite semantics, absolute path requirements, size limits, content exclusions, and side effects. An agent has everything needed to call this tool correctly and predict its results.

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 schema already documents every parameter. The description adds meaningful semantics beyond the schema, such as which formats are returned inline versus written to disk, that output_path must be absolute, and that binary exports report saved_to and bytes. This is more than a baseline 3 but not quite a 5 because the schema itself already carries good 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 action ('Exports the document via Drive') and a specific resource (a Google Doc identified by document_id). It also distinguishes between text and binary export behaviors, and explicitly positions format=markdown as the way to read a doc as Markdown for a round trip with import_markdown, which differentiates it from sibling read tools.

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?

The description gives clear context for when to use the tool, including the markdown round-trip use case and the requirement of output_path for binary formats. It does not explicitly list exclusions or name sibling alternatives like read_document_text, but the practical usage guidance is clear enough that an agent can select it appropriately.

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