Skip to main content
Glama

batch_update_doc

Execute multiple document operations in a single atomic batch to insert, format, or modify Google Docs content efficiently and avoid index calculation errors.

Instructions

Executes multiple low-level document operations in a single atomic batch update.

For normal header/footer text, prefer update_doc_headers_footers. Only use create_header_footer here for advanced section-break layouts.

RECOMMENDED WORKFLOW FOR BUILDING DOCUMENTS:

To avoid index calculation errors, build documents in phases:

PHASE 1 - INSERT ALL CONTENT (use end_of_segment=true, no index math): Append text, section breaks, and page breaks sequentially. Each operation appends to the end of the body. No index needed. Example batch: [ {"type": "insert_text", "end_of_segment": true, "text": "Report Title\n"}, {"type": "insert_text", "end_of_segment": true, "text": "\nExecutive Summary\n"}, {"type": "insert_text", "end_of_segment": true, "text": "Revenue grew 15%.\n"}, {"type": "insert_section_break", "end_of_segment": true, "section_type": "NEXT_PAGE"}, {"type": "insert_text", "end_of_segment": true, "text": "Detailed Analysis\n"} ]

PHASE 2 - CREATE HEADERS/FOOTERS (if needed): For normal header/footer text, use update_doc_headers_footers (it auto-creates if missing and writes the content for you). Only include create_header_footer operations in a batch when you are intentionally managing advanced section-break-specific layouts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYesUser's Google email address
document_idYesID of the document to update
operationsYesList of operation dicts. Each operation MUST have a 'type' field. All operations accept an optional 'tab_id' to target a specific tab.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's atomic nature (all operations in a single batch), advanced use cases (e.g., section-break layouts), and workflow constraints (phases to avoid index errors). However, it lacks details on permissions, error handling, or rate limits, which are important for a mutation tool with complex operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a clear purpose and guidelines, but the detailed workflow section with phases and examples is lengthy. While informative, it could be more concise; some details (like the example batch) might be better placed in external documentation. The structure is logical but verbose for a tool description.

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?

Given the tool's complexity (3 parameters, no annotations, but with an output schema), the description is largely complete. It covers purpose, usage, behavioral context, and parameter semantics thoroughly. The output schema reduces the need to explain return values. However, it could better address error cases or atomic rollback behavior for a batch update tool.

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 significant value by explaining the semantics of operations, such as using 'end_of_segment=true' to append content without index math and providing a concrete example batch. It clarifies how parameters interact in practice, going beyond the schema's technical definitions to guide effective usage.

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 clearly states the tool's purpose as executing 'multiple low-level document operations in a single atomic batch update,' specifying the verb ('executes'), resource ('document operations'), and key characteristic ('atomic batch'). It distinguishes from siblings by explicitly naming 'update_doc_headers_footers' as an alternative for normal header/footer tasks, avoiding redundancy with other document tools.

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 provides explicit guidance on when to use this tool versus alternatives. It states to 'prefer update_doc_headers_footers' for normal header/footer text and to 'only use create_header_footer here for advanced section-break layouts,' directly addressing sibling tool selection. It also includes a detailed recommended workflow with phases, clarifying context and prerequisites for effective use.

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/HuntsDesk/ve-gws'

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