Skip to main content
Glama
knorq-ai
by knorq-ai

replace_texts

Apply one or more find/replace pairs to a .docx file in a single open/save cycle, with optional tracked changes for auditability.

Instructions

Apply one or more find/replace operations in a single open/save cycle. Use a one-element items array for a single substitution; use multiple items to batch many substitutions efficiently. Items are applied sequentially in the given order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the .docx file
itemsYesArray of find/replace pairs, applied sequentially in the given order. Under track_changes=false, a later item can match against text produced by an earlier item (e.g. alpha→beta then beta→gamma yields gamma). Under track_changes=true, the engine rejects overlapping items (where item N's search matches item M's replace, M<N) with INVALID_PARAMETER — issue separate replace_texts calls instead.
track_changesNoRecord edits as tracked changes (w:del/w:ins). Default true.
authorNoAuthor name for tracked changesClaude
allow_untracked_editNoCapability flag required to disable tracked changes. When track_changes is false, this must also be true or the call fails with UNTRACKED_EDIT_NOT_ALLOWED. Default false. This is a safety guard against prompt injection or long-context drift in regulated-industry use — silent edits to legal/regulated documents must be opted into with two independent flags.
include_headers_footersNoAlso replace text in headers and footers. Default false.
Behavior5/5

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

No annotations are present, so the description carries full burden. It discloses sequential application, interaction with track_changes, overlapping item rejection, and the safety guard for allow_untracked_edit, which is critical for regulated industries.

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?

Four sentences, front-loaded with main purpose, followed by usage details. Every sentence adds value; no redundancy.

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?

Given 6 parameters and no output schema, the description covers all behavioral aspects: track_changes options, sequential application, headers/footers, and safety flag. No gaps identified.

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?

Schema coverage is 100%, baseline 3. The description adds meaning by explaining the sequential application logic for items and the safety guard for allow_untracked_edit, going beyond the schema's descriptions.

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 starts with a specific verb+resource: 'Apply one or more find/replace operations'. It clearly distinguishes from sibling tools like search_text (which only searches) and format_text (which formats).

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

Usage Guidelines4/5

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

Explicit guidance on using a one-element vs multiple items, and explains sequential application and overlapping item handling with track_changes. Lacks explicit alternatives but provides clear context for efficient batching.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/knorq-ai/docx-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server