Skip to main content
Glama

Insert text

insert_text

Insert plain text into a Google Doc at a chosen position or append it to the end. Use precise indexes for targeted edits; newlines create paragraphs and the inserted text inherits the surrounding style.

Instructions

Inserts plain text at an index (UTF-16 code units; body content starts at index 1 — get indexes from read_document_text). Omit index to append at the end of the body (or of the segment when segment_id is set). Newlines in the text create new paragraphs; the text inherits the style at the insertion point — style it afterwards with style_text/style_paragraph. Every insert shifts all later indexes, so when making several edits, apply them from the END of the document backwards or re-read between edits. Returns the batchUpdate reply with the new revisionId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text to insert; \n starts a new paragraph.
indexNoInsertion index (from read_document_text). Omit to append at the end.
tab_idNoTab to target (from list_tabs). Omit for the first/only tab.
segment_idNoHeader/footer/footnote segment id (from get_document). Omit for the document body.
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false), it discloses important side effects: every insert shifts later indexes, newlines create paragraphs, inserted text inherits style at the insertion point, and the call returns a batchUpdate reply with revisionId. This is exactly the behavioral context an agent needs.

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?

Four dense sentences, each carrying independent operational value: indexing, append semantics, formatting behavior, and shift ordering. The most important constraint (index source) is front-loaded.

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 with five parameters and no output schema, the description covers invocation, index acquisition, ordering under repeated edits, and return value. The tab_id omission is acceptable because schema documents it and the description handles the more complex segment/index behavior.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds substantial meaning: UTF-16 code units, body starts at index 1, omit index to append, segment behavior, and newline handling. These details are not inferable from the schema alone.

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 opens with a precise verb and resource: 'Inserts plain text at an index' and immediately defines the indexing scheme. It distinguishes itself from sibling insert_* tools by restricting to plain text and from replace/delete tools through the insert-at-index semantics.

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?

It provides clear context: how to obtain indexes, append behavior, newline paragraph creation, and ordering advice for multiple edits. It does not explicitly state 'use replace_range instead when replacing' or otherwise enumerate exclusions, so it falls short of full when/when-not guidance.

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