Skip to main content
Glama

replace_text

Replace text in a Word paragraph with precision using context anchoring, and optionally mark changes as tracked for review or apply immediately.

Instructions

Replace text in a paragraph.

With tracked=True (default) the old text is shown as red strikethrough and the new text as an underlined insertion — the human reviewer accepts/rejects in Word. Only the actually-changed portion is marked; common leading/trailing text is left as plain runs. With tracked=False the replacement is applied immediately without any visible markup.

Args: para_id: paraId of the target paragraph. find: Text to find and replace (may span run boundaries). replace: Replacement text. author: Author name shown in Word's review pane (tracked=True only). context_before: Text immediately before the target (for precise anchoring). context_after: Text immediately after the target (for precise anchoring). tracked: True (default) = strikethrough + underline the human accepts/rejects. False = replaced immediately, no markup. document_handle: Optional handle for concurrent session isolation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
findYes
authorNoClaude
para_idYes
replaceYes
trackedNo
ignore_caseNo
context_afterNo
context_beforeNo
document_handleNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It explains the tracked behavior in detail (red strikethrough, underlined insertion, common text handling) and the effect of tracked=False. It does not describe side effects like undo behavior or performance, but the disclosed traits are sufficient for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and then details parameters in a structured list. It is slightly lengthy (approx. 15 lines) but each sentence adds value. Minor redundancy exists in describing tracked behavior twice (first paragraph and parameter). Overall efficient.

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

Completeness4/5

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

Given the tool's complexity (9 params, output schema exists) and no annotation support, the description covers the essential behavioral and parameter details. It explains the critical tracked/untracked modes and anchoring. It does not describe return values, but the output schema presumably covers that. Adequate for effective invocation.

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 0%, and the description adds meaning for 8 of 9 parameters via the Args section, explaining their purpose and role (e.g., context_before for anchoring, author for review pane). However, it omits the 'ignore_case' parameter present in the schema, leaving it undocumented. Despite this, the description significantly compensates for the schema gap.

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 clearly states 'Replace text in a paragraph' and distinguishes between tracked and immediate replacement. It contrasts with siblings like bulk_replace_text by focusing on a single paragraph, and with find_replace_formatted by not mentioning formatting. The verb-resource combination is specific and unambiguous.

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

Usage Guidelines3/5

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

The description provides guidance on when to use tracked=True (for review) vs. False (immediate), and explains context_before/context_after for anchoring. However, it does not explicitly state when to choose this tool over siblings like bulk_replace_text or search_text, nor does it mention prerequisites or limitations.

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/Arvindh95Censof/grp-docx-mcp'

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