Skip to main content
Glama

insert_table

Insert a new table into a Google Docs tab after an exact text anchor. Pass rows of plain strings; the first row serves as the header. Use dry_run to preview before writing.

Instructions

Create a new table populated from rows, inserted after an anchor.

Use this tool to add a brand-new table to a document tab. rows is a list of rows of plain strings — no markdown, no bolding applied — with the first row treated as the header positionally. anchor must be exact text present in the tab; the table is inserted after the paragraph containing it, the same anchoring insert_image uses.

Set dry_run=true to preview without writing. dry_run is authoritative for index validity: the same assembled request list is index-simulated whether dry_run is true or false, and the suggestion guard below runs identically on both paths, so a passing dry_run means the real write will pass too — provided nothing about the document changes in between (a new suggestion, a concurrent edit) before the real write is issued.

Returns evidence: applied, table_index (use it for follow-up replace_table_row calls), rows, columns, first_row, table_confirmed, revision_before, revision_after, audit_logged.

Errors: TAB_NOT_FOUND – tab_id not in document QUOTE_NOT_FOUND – anchor not found; nearest candidates listed INVALID_INPUT – empty or ragged rows, a non-string cell, or an anchor that falls inside a table REVISION_CONFLICT – document changed mid-call; re-read and retry SUGGESTIONS_PRESENT – tab has pending suggested edits; accept/reject them in the Docs UI first, then retry VERIFICATION_FAILED – post-write re-read did not confirm the inserted table at the expected location INDEX_SIMULATION_FAILED – compiled requests would land at an invalid index; caught before the API call AUTH_EXPIRED – no valid token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
anchorYes
doc_idYes
tab_idYes
dry_runNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries full behavioral burden and does so thoroughly. It explains dry_run semantics, the authority of dry_run for index validity, the identical simulation path for both dry_run and real writes, the caveat about document changes, return evidence fields, and every error condition. This is far beyond a basic mutation description.

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 long but densely informative, with no filler. It front-loads the core purpose and usage, then uses structured lists for return evidence and errors. Every sentence adds value, especially the detailed dry_run guarantee and the exhaustive error catalog.

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?

Given the tool's complexity, absence of annotations, and rich error surface, the description is effectively complete. It covers purpose, parameter behavior, anchoring, dry_run semantics, return evidence, and all expected failures. The output schema exists, but the description still lists the return fields, making the agent fully equipped to invoke and interpret the 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 0%, so the description must compensate. It explains rows in detail (plain strings, first row positional header), anchor requirements (exact text, inserted after containing paragraph), and dry_run behavior. doc_id and tab_id are not individually explained beyond error context, but they are self-evident identifiers and the error list clarifies tab_id. This is strong compensation for a 0%-coverage schema.

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 specific verb and resource: 'Create a new table populated from rows, inserted after an anchor.' It clearly distinguishes this from sibling operations like replace_table_row and insert_image while using the same anchoring concept as insert_image. An agent can immediately tell what the tool does and how it differs from related 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 use: adding a brand-new table to a document tab, with rows as plain strings and an anchor that must be exact text. It references the same anchoring behavior as insert_image and mentions replace_table_row as a follow-up, but it does not explicitly state when not to use this tool or directly compare it with alternatives like append_markdown.

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