Skip to main content
Glama
wkqco33
by wkqco33

word_replace_text

Find and replace text in Word documents across paragraphs and tables, with optional backup and replacement count control.

Instructions

Find and replace text across paragraphs and tables in a Word document.

Args:
    file_path: Path to the Word document (.docx).
    find_text: Text string to find.
    replace_text: Replacement text string.
    count: Maximum number of replacements (-1 for all occurrences).
    backup: If True, create a backup of the original file before modifying.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
backupNo
file_pathYes
find_textYes
replace_textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations present, the description correctly shoulders the safety burden by disclosing that the original file is modified and that a backup can be created beforehand. The scope boundary 'across paragraphs and tables' is also a useful behavioral trait. It stops short of explicitly stating irreversibility, but the backup option and 'before modifying' wording make the side effect clear.

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?

A single purpose-led sentence is followed by a compact, consistently formatted Args list with no filler or restatement of schema defaults. Each line adds distinct information.

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 mutating tool with no annotations and no schema descriptions, the description supplies the essential context: file path, find/replace strings, replacement-count semantics, and backup behavior. Since an output schema exists, the absence of return-value prose is not a gap.

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 Args block is the only source of parameter meaning. It fully compensates by documenting all five parameters, including the meaning of the count sentinel (-1) and the backup condition.

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 names a concrete operation ('Find and replace'), a resource ('Word document'), and a precise scope ('across paragraphs and tables'). This is specific enough to distinguish the tool from read-only siblings like word_search and from cell/table writers.

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

Usage Guidelines2/5

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

There is no guidance about when to choose this tool over siblings such as word_search or word_write_table_cell, and no exclusions are stated. The intended use is only implied by the name and first sentence.

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