Skip to main content
Glama

edit_document

Compile semantic document edits into correct Google Docs batchUpdate requests by handling UTF-16 arithmetic and cascading index shifts to prevent silent document corruption.

Instructions

Make changes to a Google Doc with correct index arithmetic.

You cannot safely modify a Google Doc by constructing batchUpdate
requests yourself. The API uses UTF-16 code units with cascading index
shifts — insert 10 characters at position 50, and every subsequent
index in your batch is wrong. A single miscalculation silently corrupts
the document with no error message. This tool compiles your semantic
intent into a correct request sequence.

**Recommended flow:** call read_document first, then describe your
changes using heading names or named ranges as addresses.

Valid operation types: insert_text, delete_content, replace_all_text,
replace_section, update_text_style, update_paragraph_style,
create_paragraph_bullets, convert_to_list, insert_table,
insert_table_row, insert_table_column, delete_table_row,
delete_table_column, insert_bullet_list, insert_numbered_list,
insert_page_break, insert_inline_image, create_header, create_footer,
create_footnote, create_named_range, delete_named_range,
replace_named_range_content.

Args:
    document_id: The Google Docs document ID.
    operations: List of operation dicts. Each has:
        - type: one of the operation types listed above
        - address: target location ({"heading": "Budget"}, {"start": true}, etc.)
        - params: operation-specific parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYes
operationsYes
Behavior5/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 thoroughly explains critical behavioral traits: the tool prevents index miscalculation issues that could silently corrupt documents, compiles semantic intent into correct sequences, and lists all valid operation types. This goes well beyond basic functionality disclosure.

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 appropriately sized and well-structured with clear sections: problem context, recommended flow, operation types, and parameter documentation. While comprehensive, every sentence adds value, though the operation type list is lengthy but necessary for completeness.

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 mutation tool with no annotations and no output schema, the description provides exceptional completeness. It covers the why (index arithmetic dangers), how (recommended flow), what (operation types), and parameter details. The only minor gap is lack of explicit error handling information, but this is compensated by the thorough behavioral context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by explaining both parameters in detail. It defines document_id as 'The Google Docs document ID' and provides comprehensive documentation for the operations parameter structure, including the type field with all valid values, address field examples, and params field purpose.

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: 'Make changes to a Google Doc' with specific details about handling index arithmetic and compiling semantic intent into correct request sequences. It distinguishes from sibling tools by mentioning read_document as part of the recommended flow and implicitly contrasting with validate_operations by focusing on execution rather than validation.

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 usage guidance: 'call read_document first, then describe your changes using heading names or named ranges as addresses.' It also implicitly advises against manual batchUpdate construction by explaining the risks, effectively stating when not to use alternatives.

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/ConvergentMethods/arezzo'

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