Skip to main content
Glama

Word Tables, Lists and Layout

word_structure
Destructive

Create and modify Word tables, lists, sections, page setup, headers, footers, and page numbers, including bulk cell edits and table structure changes.

Instructions

Tables, lists and page layout: create and change tables and lists, sections, page setup, headers and footers, and page numbers. Body text is word_edit. Every edit backs the file up first and saves atomically. set_cells edits a document open in Word live; the other ops refuse it. Ops, one per line, as name(required; opt optional): what it does. file_path, live and backup are not repeated; word_help shows them:

  • set_header_footer(part, text; opt section ref_type alignment include_page_number replace_content): Set a section's header or footer text, replacing the whole part. ref_type 'first' is a different first page, no section break needed.

  • set_section_properties(opt section orientation page_width_pt page_height_pt margins_pt columns line_numbering): Set one section's page size, orientation, margins, columns and line numbering; with no changes it returns the current values.

  • insert_list(items; opt kind location continue_from start_at levels): Insert a bulleted or numbered list with real bullet/number glyphs (numbering.xml as needed).

  • create_table(data; opt location header_row width_pt): Create a table from 2D string data with single-line borders and a bold repeating header row (header_row=False for none).

  • set_table_properties(table_index; opt style banded_rows first_row_header column_widths header_row_repeat): Set table-wide attributes; pass any combination.

  • set_cells(table_index; opt edits block nested track author): Write many table cells in one call.

  • delete_table(table_index): Delete a whole table and its contents.

  • modify_table_structure(table_index, action; opt target at count copy_format_from width_pt start end columns range row cell at_row): Insert or delete rows or columns, or merge, unmerge or split one table (action picks which; extra arguments are refused).

  • format_cells(table_index, targets, formatting): Format table cells in bulk. More ops follow, in the same format, in the op parameter's description.

Input Schema

NameRequiredDescriptionDefault
opYesThe operation to run: an op listed in this tool's description, or one of these, in the same format: - sort_table(table_index, column; opt numeric descending has_header): Sort a table's data rows by one column (CELL index, 0-based). - import_table(data; opt table_index at_end after_text has_header): Fill a table from data: a .csv path, a .json path (export_table's form or a bare row list), or an inline list of lists. - set_list_numbering(num_id; opt restart_at level continue_from levels force): Change how one existing list numbers itself (num_id from list_elements(type='lists')). - set_page_numbers(opt section position alignment prefix x_of_y format): Add a page-number field to the header or footer, and set a section's number format and starting number. - setup_chapter_headers(opt level include_number alignment first_page_blank scope): Put the current chapter title in each page's running header with a STYLEREF field; other header content is replaced. - move_section(heading_text; opt before_heading after_heading at_end): Move a heading and its ENTIRE section (content and tables until the next same-or-higher heading) before or after another heading, or to the end.
argsNoThe op's arguments as an object. Include file_path (the absolute .docx path) unless the op's line names other paths or the op reads no document; unknown keys are refused. word_help lists every argument.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations, it discloses that every edit backs up the file first and saves atomically, and that all ops except set_cells refuse a live Word document. It also notes destructive actions like deleting a whole table and replacing the whole header/footer part, which is valuable behavioral context for a destructiveHint=true tool.

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 long but warranted for a 15-op tool. Purpose and critical behavioral constraints are front-loaded, and the one-op-per-line catalog is structured for scanning; the note that remaining ops appear in the op parameter description prevents duplication.

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?

For a complex multi-operation mutation tool with no output schema, the definition covers invocation details, safety behavior, live-document constraints, and op-specific argument requirements. The split between main description and op enum description is clearly signposted, leaving no obvious gap for an agent to call it correctly.

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?

Although schema coverage is 100%, the description adds operation-level semantics: required versus optional arguments for each listed op, meaning of values like ref_type 'first', and refusal of extra arguments in modify_table_structure. It also correctly delegates file_path/live/backup details to word_help rather than repeating them.

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 names a specific resource and scope: tables, lists, page layout, sections, headers/footers, and page numbers. It distinguishes itself from the sibling word_edit by stating 'Body text is word_edit,' so an agent can route correctly without opening either schema.

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

Usage Guidelines5/5

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

It explicitly identifies the alternative for body text and gives a key usage condition: 'set_cells edits a document open in Word live; the other ops refuse it.' The operation catalog further clarifies when to use each op, including special cases like no section break being needed for a first-page header.

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