word_add_table
Append a table to a Word document with specified rows, columns, and optional data and style.
Instructions
Append a table to the body of the document.
Args:
path: Path to an existing .docx.
rows: Number of rows (must be a positive int).
cols: Number of columns (must be a positive int).
data: Optional 2D list of strings to populate the cells. The
list is interpreted in row-major order; shorter rows are
padded with empty strings and longer rows are truncated.
style: Optional built-in table style name (e.g. "Table Grid"
or "Light Grid Accent 1").
folder: Optional base folder for relative paths.
Returns:
{"index": <n>} where <n> is the index of the new table
in doc.tables.
Raises:
OfficeMCPError: ERR_INVALID_PARAMS for non-positive
rows/cols, unknown style, or a non-list
data argument. ERR_FILE_NOT_FOUND if the file is
missing, ERR_UNSUPPORTED_FMT for non-.docx
extensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| rows | Yes | ||
| cols | Yes | ||
| data | No | ||
| style | No | ||
| folder | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||