table_row_insert
Insert a row into a Word body table as a tracked change, after a chosen row with one value per cell. Preview with dry_run and use SHA-256 guards to refuse stale-file edits.
Instructions
Insert a row into a body table as a tracked change: after row after_row (0: before the first), with one text per cell in cells (e.g. ["2024", "12.5"]), matching the row it follows (SCHEMA_INVALID otherwise). Refused (UNSUPPORTED_CONTENT) between two rows a vertical merge spans. Backed up and logged for history.undo; dry_run previews; expect.sha256 refuses a changed file. Use doc.batch for several rows at once.
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": "<doc>",
"table": "<table>",
"after_row": "<after_row>",
"cells": "<cells>"
},
"name": "table_row_insert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Path to the .docx. | |
| tag | No | Appended to the author. | |
| cells | Yes | One text per cell of the row it follows (the first row for after_row 0); a horizontally merged cell is one cell. | |
| table | Yes | Table number as `table.get` numbers it: 1-based, in document order, main story only (a table in a note, header or footer cannot be named here). | |
| author | No | Revision author. | |
| expect | No | Write guard: the sha256 read earlier (doc.info, or a reply's doc.sha256), e.g. {"sha256": "9f86d081…"}; a file changed since is DOC_CHANGED_ON_DISK. | |
| dry_run | No | Preview only; write nothing. | |
| after_row | Yes | Insert after this row (1-based); 0 inserts before the first row. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Always true on success. | |
| op | Yes | The operation that ran. | |
| api | Yes | API version (1.0). | |
| doc | No | The document read or written: path, sha256 and paragraph count. | |
| next | Yes | Cursor for the next page (pass as cursor), or null. | |
| result | Yes | What the operation returns. | |
| warnings | Yes | Things to know about the result. |