Skip to main content
Glama

insert_doc_table

Destructive

Inserts an empty table at a chosen Google Docs position and returns cell indices for filling cells or applying formatting; also supports form-style column alignment.

Instructions

Insert an empty table at a specific position in a Google Doc.

The table is inserted at the given index. The document is re-fetched immediately to return the actual cell indices. Use those indices with insert_doc_text (targeting each cell's paragraphStartIndex) to fill cells, or with style_doc_table_cells to apply formatting.

Also useful for form-style column alignment (labels/values lined up without a visible table) — a zero-padding table gives exact column positions where tabStops would otherwise be needed (tabStops itself is read-only, #404). See docs/design/borderless-table-columns.md for the full recipe.

Args: doc_id: The Google Doc file ID. index: Document body index where the table should be inserted. Use get_doc_structure to find a suitable position (e.g. the endIndex of the paragraph before the intended location). rows: Number of table rows. columns: Number of table columns.

Returns: precedingParagraphIndex (= index), tableStartIndex (= index + 1), tableEndIndex, rows, columns, and a cells list (each cell has row, col, startIndex, endIndex, paragraphStartIndex). To fully delete the table later, delete the range [precedingParagraphIndex, tableEndIndex] in one call.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "doc_id": "<doc_id>",
      "index": "<index>",
      "rows": "<rows>",
      "columns": "<columns>"
    },
    "name": "insert_doc_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowsYes
indexYes
doc_idYes
columnsYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only supply destructiveHint=true; the description adds real behavior—the document is re-fetched immediately so the returned cell indices are the actual ones, and full removal requires deleting the range [precedingParagraphIndex, tableEndIndex] in one call (revealing the extra preceding paragraph the insert creates). It does not discuss permission requirements or what happens to indices of content after the insertion point, so it stops short of full behavioral 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?

Front-loaded with the core action in one sentence, then position/index guidance, then returns. The borderless-table paragraph and the '#404' aside are useful but digressive for a first-time caller, adding length without helping the primary invocation.

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?

Despite an output schema existing, the Returns block names the exact fields the agent must wire into the next call, which is what makes this tool usable in a chain. Combined with index-finding guidance and the deletion recipe, nothing essential for correct invocation 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 0%, so the Args block carries the load and does document all four parameters, including non-obvious index semantics (a body index, findable via get_doc_structure's endIndex of the preceding paragraph). rows/columns get only a bare restatement, but their meaning is self-evident.

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, resource, and scope: an EMPTY table inserted at a specific position in a Google Doc. It goes further and names the sibling tools used for the follow-up steps (insert_doc_text for cell contents, style_doc_table_cells for formatting), so the agent can place this tool in the workflow without opening another schema.

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 says how to pick the index (use get_doc_structure, e.g. the paragraph's endIndex before the target location) and which sibling to call next for each follow-up task. It even describes an alternate use case (borderless zero-padding tables for column alignment, where tabStops is read-only) with a pointer to the recipe doc.

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

Deploy Server

Other Tools