Skip to main content
Glama

r7_replace

Replace text in DOCX files while preserving all run formatting, fonts, colors, and styles. Specify search and replacement, with options for case sensitivity, output path, and replace all.

Instructions

Search and replace text in DOCX while strictly preserving all existing run formatting, fonts, colors, and styles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesText substring or pattern to find.
replaceYesReplacement text.
filePathYesPath to the DOCX file.
matchCaseNoCase sensitive matching (default true).
outputPathNoOptional target path.
replaceAllNoReplace all occurrences (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden — and it does disclose one important behavioral trait: replacement preserves existing run formatting, fonts, colors, and styles. However, it says nothing about whether the original file is mutated in place versus only written to outputPath, nor about error behavior when the search text is absent.

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 sentence with no padding, front-loading the action before the formatting-preservation guarantee. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 6-parameter mutation tool with no annotations and no output schema, the description omits in-place-vs-outputPath semantics and any result/error information. The formatting-preservation guarantee is the main value added; the rest of the behavioral surface is thin.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters (including matchCase and replaceAll defaults) are already documented in the schema. The description adds no syntax or format detail beyond that; the mention of 'run formatting' is behavioral rather than parameter-level. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource ('search and replace text in DOCX') plus a distinguishing scope note ('strictly preserving all existing run formatting, fonts, colors, and styles'). It is clear what the tool does, though it never explicitly distinguishes itself from the sibling mutation tools r7_edit or r7_insert.

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 when-to-use guidance: nothing says when to pick this over r7_edit or r7_insert, or what preconditions exist (e.g., file must exist, format must be DOCX). Usage is only implied by the verb 'replace'.

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