Skip to main content
Glama

Delete Element

delete_element
Destructive

Delete specific document elements like equations, images, charts, bookmarks, hyperlinks, captions, and content controls from Word files, with automatic backup and reference cleanup.

Instructions

Delete one document element that has no lifecycle tool of its own. type: equation | image | chart | bookmark | hyperlink | caption | reference_list | content_control. Address equations, images, charts by their list_elements index; reference_list (TOC, List of Tables/Figures, index) by its read order; bookmarks by name (markers go, the text stays; Word-internal underscore names refused); hyperlinks by target url in id and/or a location search on the link text (the link is unwrapped, display text kept, the relationship dropped once unshared; several matches without occurrence refuse loudly listing every candidate); captions by location (Caption-styled paragraphs only); content controls by tag or index (the whole control including content; locked controls refused). Deleting an image or chart also removes its media, chart, and embedded-workbook parts once nothing else references them. Objects with lifecycle tools stay there: notes in manage_note (academic pack), comments in manage_comment (review pack), sources in manage_source (references pack), tables in delete_table, paragraphs in delete_paragraphs. 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
idNo
typeYes
backupNo
locationNo
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses side effects (removal of media, chart, and embedded-workbook parts), backup rotation behavior, atomic validated save, refusal of locked controls and Word-open documents, and the unwrap/drop-relationship behavior for hyperlinks. This substantially exceeds what annotations alone convey.

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?

Though dense, the description earns its length: every clause maps to a decision an agent must make. The scope is front-loaded and the content is grouped per element type with consistent delimiter usage.

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 tool with 5 parameters, 0% schema coverage, and many element variants, the description covers addressing, side effects, refusals, backup behavior, and exclusions. Nothing essential is left unspecified.

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%, so the description carries the full burden, and it does. It explains how id, location, type, and backup are used differently across element types, including index, read order, name, target URL, tag, and skip-rotation semantics.

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?

States a specific verb and resource: delete one document element with no lifecycle tool of its own. It enumerates the exact element types covered and explicitly contrasts with sibling tools like delete_table and delete_paragraphs, so an agent can readily distinguish it.

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 says when to use this tool versus alternatives: 'Objects with lifecycle tools stay there' and names each sibling tool for notes, comments, sources, tables, and paragraphs. It also gives per-type addressing rules and refusal conditions, providing full usage routing.

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