Skip to main content
Glama

replace_text

Find and replace text in a paragraph, optionally marking changes with strikethrough and underline 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
para_idYes
findYes
replaceYes
authorNoClaude
context_beforeNo
context_afterNo
ignore_caseNo
trackedNo
document_handleNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It explains tracked changes appearance (red strikethrough, underlined insertion), that only the changed portion is marked, and that author is used only in tracked mode. It also mentions document_handle for session isolation. Missing details on output/return value and ignore_case behavior.

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 well-structured with an introductory paragraph and Args section. It is reasonably concise for the complexity, though some redundancy exists (e.g., explaining tracked twice). Every sentence adds value, but could be tightened.

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?

Given the complexity (9 parameters, optional output schema), the description covers input semantics and behavior well but omits critical details: return value/success indication, error handling when find is not found, and the ignore_case parameter. This leaves the agent without complete guidance for all configurations.

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?

The description adds meaning to 8 of 9 parameters (para_id, find, replace, author, context_before, context_after, tracked, document_handle), explaining their roles and interactions such as context_before/context_after for anchoring. However, ignore_case is present in schema but absent from description, creating a gap despite overall strong coverage.

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', which is a specific verb and resource. It distinguishes itself from siblings like delete_text or find_replace_formatted by detailing tracked changes behavior.

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?

The description explains when to use tracked=True vs False, and provides context for precise anchoring with context_before/context_after. However, it lacks explicit guidance on when not to use this tool, such as for batch operations or case-insensitive replacement (ignore_case is missing from the description).

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

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