Skip to main content
Glama

delete_table

Delete an entire table and its contents from a Word document by table index, including nested tables. Use to remove a table completely while keeping the document structure intact.

Instructions

Delete a whole table and its contents. table_index is the 0-based position among body-level tables in document order, as reported by list_elements(type='tables') or get_document_view; nested tables are removed with their host table. To clear cell values while keeping the grid, use set_cells instead. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backupNo
file_pathYes
table_indexYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only mark readOnlyHint=false, so the description carries the burden of explaining destructive behavior. It does this thoroughly: nested tables are removed with the host, backup slots rotate in .ks4w-backups, backup=False only skips rotation, the save is atomic and validated, and Word-open documents are refused.

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 main action is front-loaded in the first sentence, and each subsequent sentence adds necessary behavioral or usage detail without repetition. The text is dense but well organized and every clause earns its place.

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 destructive table tool with an output schema present, the description covers what is deleted, how to identify the target, side effects on nested tables, backup behavior, save semantics, and a failure condition. No critical operational detail is missing.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates strongly: table_index is fully specified as 0-based among body-level tables in document order and sourced from list_elements/get_document_view, and backup behavior is defined. file_path is not explicitly described, though its meaning is clear from the tool context.

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 opening sentence states a specific action and object: 'Delete a whole table and its contents.' It also clarifies the meaning of table_index and distinguishes the operation from set_cells, so the agent can identify this as the whole-table deletion tool among siblings like delete_paragraphs and set_cells.

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?

The description explicitly gives an alternative for a different intent ('To clear cell values while keeping the grid, use set_cells instead') and tells the agent where to obtain a valid table_index via list_elements or get_document_view. It also warns that the tool refuses documents open in Word, which is a clear when-not condition.

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