Skip to main content
Glama

replace_text

Destructive

Replace text in a specific paragraph by its ID while preserving formatting. Supports DOCX, ODT, and Google Docs with tracked changes.

Instructions

Replace text in a paragraph by provider paragraph id, preserving formatting where supported. Supports DOCX, ODT, and Google Docs. Surface: revisionable — DOCX edits emit native OOXML tracked changes (w:ins/w:del/w:rPrChange).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNoPath to the DOCX or ODT file.
new_stringYes
old_stringYes
instructionYes
google_doc_idNoGoogle Doc ID or URL (alternative to file_path). Extract from URL: docs.google.com/document/d/{ID}/edit
normalize_firstNoMerge format-identical adjacent runs before searching. Useful when text is fragmented across runs.
target_paragraph_idYes
Behavior4/5

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

Beyond the annotations (destructiveHint=true, readOnlyHint=false), the description adds that for DOCX, edits emit native OOXML tracked changes. This is valuable behavioral context. However, it doesn't detail what happens for ODT or Google Docs in terms of revision tracking.

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 three sentences, front-loaded with the main action and supported formats. It is efficient with no unnecessary words, though the 'Surfacing' clause could be more integrated.

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 (7 params, destructive, no output schema), the description covers core purpose, format support, and a key behavioral trait. However, it lacks information on return values, error conditions, or behavior for non-DOCX formats. With no output schema, this leaves gaps.

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

Parameters2/5

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

Only 43% of parameters have schema descriptions, and the tool description adds little beyond the schema. The 'normalize_first' and 'instruction' parameters are not elaborated in the description. The required 'target_paragraph_id' lacks any description, even though the tool description mentions 'by provider paragraph id'.

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 the action ('Replace text in a paragraph by provider paragraph id'), specifies supported formats (DOCX, ODT, Google Docs), and emphasizes formatting preservation. This strongly distinguishes it from sibling tools like 'batch_edit' or 'insert_paragraph'.

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 outlines supported formats but provides no explicit guidance on when to use this tool versus alternatives (e.g., when a simple find/replace is needed vs. batch operations). No 'when not to use' or alternative tool mentions are present.

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/UseJunior/safe-docx'

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