Skip to main content
Glama

Modify Doc Text

modify_doc_text
Destructive

Update Google Docs content directly: insert or replace text, then apply formatting like bold, italics, colors, links, and fonts in a single call.

Instructions

Modifies text in a Google Doc - can insert/replace text and/or apply formatting in a single operation.

TIP: To append text to the end of the document without calculating indices, set end_of_segment=true. This avoids index calculation errors.

For ordinary header/footer text, prefer update_doc_headers_footers. Only pass segment_id when you already have a real header/footer/footnote segment ID from inspect_doc_structure output. Do not guess IDs such as "kix.header" or "kix.footer".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boldNoWhether to make text bold (True/False/None to leave unchanged)
textNoNew text to insert or replace with (optional - can format existing text without changing it)
italicNoWhether to make text italic (True/False/None to leave unchanged)
tab_idNoOptional document tab ID to target
link_urlNoHyperlink URL (http/https)
end_indexNoEnd position for text replacement/formatting (if not provided with text, text is inserted)
font_sizeNoFont size in points
underlineNoWhether to underline text (True/False/None to leave unchanged)
clear_linkNoRemove hyperlink from the target range
segment_idNoOptional header/footer/footnote segment ID to target
small_capsNoWhether to apply small caps
text_colorNoForeground text color (#RRGGBB)
document_idYesID of the document to update
font_familyNoFont family name (e.g., "Arial", "Times New Roman")
font_weightNoFont weight (100-900 in steps of 100; requires font_family)
start_indexYesStart position for operation using Docs API indices from inspect_doc_structure. For the main body, 0 is also accepted as an alias for the first writable position.
strikethroughNoWhether to strike through text (True/False/None to leave unchanged)
end_of_segmentNoInsert text at the end of the targeted segment instead of start_index
baseline_offsetNoOne of NONE, SUPERSCRIPT, SUBSCRIPT
background_colorNoBackground/highlight color (#RRGGBB)
user_google_emailYesUser's Google email address

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already signal mutation and destructiveness, and the description adds useful context: a single operation can combine text insertion/replacement with formatting, and end_of_segment avoids index calculation errors. The segment_id warning adds a safeguard about where IDs must come from. The description doesn't enumerate every destructive consequence, but 'replace' plus destructiveHint covers the core risk.

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 four sentences with no filler. The main capability is front-loaded, followed by a practical tip and two targeted warnings. Every sentence earns its place.

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?

For a 21-parameter mutating tool, the description covers the main operations, a common failure mode, and the sensitive segment_id case, while the output schema handles return details. It does not explicitly explain deletion via empty-text replacement or all parameter combinations, but the schema covers those mechanics. Overall this is solid but not exhaustive.

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?

All 21 parameters have schema descriptions, so the baseline is 3. The description adds genuinely non-obvious guidance: end_of_segment=true avoids index calculation errors, and segment_id should only come from inspect_doc_structure output, not guessed values. This goes beyond what the schema property descriptions provide.

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 and resource: 'Modifies text in a Google Doc.' It clearly distinguishes the tool's capabilities by naming insert, replace, and formatting in a single operation, and the header/footer note helps separate it from update_doc_headers_footers.

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 explicitly routes ordinary header/footer text to update_doc_headers_footers and warns against passing guessed segment IDs. It also gives concrete when-to-use advice for end_of_segment=true, making the selection and invocation guidance direct.

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

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/WorldCentralKitchen/google_workspace_mcp'

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