Skip to main content
Glama

Insert table into Google Doc

insert_table

Insert an empty table with specified rows and columns at a chosen index in a Google Doc, enabling structured content directly in your document.

Instructions

Insert an empty table with the given number of rows and columns at an index of a Google Doc. Google inserts a paragraph break before the table, so the table starts at index + 1 (returned as tableStartIndex). The index must be inside an existing paragraph — not at a table’s start and not inside a footnote; to add a table at the end use bodyEndIndex-1 from get_document. Every cell starts with an empty paragraph: call get_document afterwards to get exact cell indexes, then fill cells with insert_text starting from the LAST cell so earlier indexes stay valid. Inserting shifts every later index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYesNumber of rows (1-100).
indexYesA Google Docs index (UTF-16 offset). The body starts at index 1. Get exact indexes from get_document (structure) or find_text.
columnsYesNumber of columns (1-20).
documentIdYesThe Google Docs document ID (the part between /d/ and /edit in the document URL). A full Google Docs URL is also accepted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only supply the generic mutation profile (not read-only, not idempotent, open-world). The description adds non-obvious operational behavior beyond that: Google inserts a paragraph break so the table actually starts at index+1 (returned as tableStartIndex), every cell begins with an empty paragraph, and all later indexes shift after insertion.

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?

Front-loaded with the core action in sentence one, then behaviors, then the fill workflow. Dense but every clause carries actionable information; the cell-fill ordering note ('start from the LAST cell') is slightly beyond the core insert task but still earns its place given the index-shift warning.

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 destructive-free but index-shifting mutation with no output schema, the description covers the resulting offset behavior, the returned tableStartIndex, cell paragraph initialization, and the required follow-up calls. Nothing an agent needs to invoke and then use this tool correctly is missing.

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 already 100%, so the baseline is 3, but the description contributes real semantics the schema lacks: the index must fall inside an existing paragraph, must not be a table start or footnote, and the bodyEndIndex-1 convention for appending. Range details (1-100 rows, 1-20 cols) are left to the 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?

States a specific verb and resource ('Insert an empty table ... at an index of a Google Doc') plus the key qualifier that the table is empty. This clearly distinguishes it from sibling mutations like insert_text, insert_page_break, and create_bulleted_list.

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?

Explicitly states placement constraints (index must be inside an existing paragraph, not at a table's start, not inside a footnote), names the workaround for appending (bodyEndIndex-1 from get_document), and directs the agent to get_document + insert_text for the follow-up fill step. When-to-use, when-not-to-use, and alternatives are all covered.

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