Skip to main content
Glama

replace_text

Destructive

Replace text in a specific paragraph using its ID, preserving original formatting. Works with DOCX, ODT, and Google Docs.

Instructions

Replace text in a paragraph by provider paragraph id, preserving formatting where supported. Supports DOCX, ODT, and Google Docs.

Input Schema

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

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

Annotations declare destructiveHint=true, which aligns with replacement. The description adds that formatting is preserved 'where supported', which is useful but incomplete. It does not clarify what happens when formatting cannot be preserved or other behavioral traits like finality or authentication needs.

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?

The description is two sentences, each serving a clear purpose: the first describes the action and constraint, the second lists supported formats. No wasted words, front-loaded with the core function.

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

Completeness2/5

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

Given the tool's complexity (7 parameters, destructive behavior, no output schema), the description is too sparse. It does not explain the instruction parameter, return behavior, or edge cases like partial formatting preservation. The agent lacks sufficient context for correct invocation.

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?

The input schema has 7 parameters with only 43% description coverage. The description does not explain critical parameters like instruction or normalize_first beyond what the schema provides. It adds limited semantic value, leaving the agent to infer meanings from parameter names.

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'), the resource ('paragraph by provider paragraph id'), and the context ('preserving formatting where supported'). It also lists supported file formats (DOCX, ODT, Google Docs), distinguishing it from siblings like add_comment 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 implies usage for text replacement in paragraphs while preserving formatting, but it does not explicitly state when to use or avoid this tool relative to alternatives like batch_edit or clear_formatting. No exclusion criteria or when-not guidance is provided.

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