Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
rowsYes
colsYes
dataNo
styleNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations are provided, so the description carries the full burden. It thoroughly discloses constraints (positive int for rows/cols), optional parameters, data handling (padded/truncated), error conditions (ERR_INVALID_PARAMS, ERR_FILE_NOT_FOUND, ERR_UNSUPPORTED_FMT), and return format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured in a Google-style docstring with clear sections for Args, Returns, and Raises. Every sentence adds value without redundancy.

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 the tool having 6 parameters, the description covers all essential aspects: purpose, parameter semantics, return value, and error handling. The context is complete for an AI agent to correctly invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description explains each parameter in detail, including constraints, default values, and behavior (e.g., data is row-major, shorter rows padded). This fully compensates for the lack of schema descriptions.

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?

The description clearly states 'Append a table to the body of the document.' This is a specific verb+resource pair, and it distinguishes itself from sibling tools like word_add_paragraph or pptx_add_table.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for adding tables to Word documents but does not explicitly provide guidelines on when to use this tool versus alternatives or when not to use it.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gawirable/office-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server