insertTableWithData
Insert a data-filled table at a chosen index in a Google Doc, writing all cells in one operation with an optional bold header row. Ragged rows are padded with empty cells.
Instructions
Inserts a table pre-populated with data at a specific index in the document. All cell content is inserted in a single operation. Optionally bolds the first row as a header. Ragged rows are padded with empty cells to match the widest row.
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": {
"documentId": "<documentId>",
"data": "<data>",
"index": "<index>"
},
"name": "insertTableWithData"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | A 2D array of strings representing the table contents. Each inner array is one row. Example: [["Name", "Age"], ["Alice", "30"], ["Bob", "25"]] | |
| index | Yes | 1-based character index within the document body where the table should be inserted. Use readDocument with format='index' to inspect indices. | |
| tabId | No | The ID of the specific tab to insert into. Use listDocumentTabs to get tab IDs. If not specified, inserts into the first tab. | |
| documentId | Yes | The document ID — the long string between /d/ and /edit in a Google Docs URL. | |
| readHandle | No | Capability returned by a previous readDocument call for this document (and tab). Required over HTTP on the 2026-07-28 runtime: it authorizes the write and pins it to the revision that read saw. Omit it on stdio to use that connection's most recent read. | |
| hasHeaderRow | No | If true, the first row is treated as a header and its text will be bolded. |