office_table
Manage tables in Word, Excel, and PowerPoint: retrieve data, add rows, update cells, or create new tables.
Instructions
Manage tables in Word, Excel, or PowerPoint documents.
Replaces: excel_get_table, excel_append_table_row, excel_update_table_row, word_get_table, word_insert_table_row, word_patch_table_row, word_create_new_table, pptx_get_table, pptx_insert_table_row, pptx_patch_table_cell
Examples: # Get Excel table data office_table(file_path="data.xlsx", operation="get", table_id="Sales")
# Add row to Excel table
office_table(
file_path="data.xlsx",
operation="add_row",
table_id="Sales",
data={"Product": "Widget", "Amount": 100}
)
# Update Excel table row
office_table(
file_path="data.xlsx",
operation="update_row",
table_id="Sales",
row_index=2,
data={"Amount": 150}
)
# Get Word table (by index, passed as string)
office_table(file_path="report.docx", operation="get", table_id="0")
# Create Word table
office_table(
file_path="report.docx",
operation="create",
data={
"headers": ["Phase", "Owner", "Target Date"],
"rows": [{"Phase": "Discovery", "Owner": "PM", "Target Date": "2026-04-01"}],
"insert_after_section": "Delivery Plan"
}
)
# Get PowerPoint table (slide number as string)
office_table(file_path="deck.pptx", operation="get", table_id="3")Args: file_path: Path to the document operation: "get" to retrieve table data, "add_row" to append a row, "update_row" to modify an existing row, or "create" to create a new table (Word and PowerPoint) table_id: Table identifier as a string. For Excel pass the table name (e.g. "Sales"). For Word pass the 0-based table index for get/add/update (e.g. "0"). For PowerPoint pass the slide number (e.g. "3"). For Word create, table_id is optional. data: Row data as a dict with column names or indices as keys and cell values as values. Required for add_row and update_row. For Word create, provide an object with "headers" and optional "rows", "insert_after_section", "insert_before_section", "output_path", and "author". For PowerPoint update_row include "row", "col", and "value" keys. row_index: 1-based row index for update_row operations
Returns: Dictionary with table data or operation result
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the document | |
| operation | No | "get" to retrieve table data, "add_row" to append a row, "update_row" to modify an existing row, or "create" to create a new table (Word and PowerPoint) | |
| table_id | No | Table identifier as a string. For Excel pass the table name (e.g. "Sales"). For Word pass the 0-based table index for get/add/update (e.g. "0"). For PowerPoint pass the slide number (e.g. "3"). For Word create, table_id is optional. | |
| data | Yes | Row data as a dict with column names or indices as keys and cell values as values. Required for add_row and update_row. For Word create, provide an object with "headers" and optional "rows", "insert_after_section", "insert_before_section", "output_path", and "author". For PowerPoint update_row include "row", "col", and "value" keys. | |
| row_index | No | 1-based row index for update_row operations | |
| output_path | No | ||
| mode | No |