Skip to main content
Glama

replace_paragraph_text

Replace a paragraph's full text while keeping its style and formatting. Use an expected substring to confirm the correct paragraph, avoiding errors after insert/delete shifts.

Instructions

Replace one paragraph's full text, keeping style and base formatting. IMPORTANT: paragraph indices SHIFT after insert/delete operations - pass expect (a substring the target paragraph currently contains) to refuse instead of silently hitting the wrong paragraph, and verify the returned replaced_text (the old text) matches what you meant to replace. For text-anchored replacement immune to index shifts, use search_and_replace; this tool is the natural fallback when a find string would exceed live search_and_replace's length limit (no limit here). Auto-backup in file mode: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Documents open in Word are edited live. Live edits leave the paragraph mark untouched (style and section breaks survive); paragraphs carrying tracked revisions are refused live - accept/reject first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
liveNoauto
indexYes
backupNo
expectNo
new_textYes
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses index-shift hazards, expect-based refusal, returned replaced_text, backup/rotation behavior, atomic validated saves, live-edit semantics, paragraph-mark preservation, and rejection of paragraphs with tracked revisions.

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 dense but every sentence and clause adds operational value. The core purpose is front-loaded, followed by warnings, alternative routing, backup behavior, and live-mode constraints, with no filler.

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?

The description covers the essential hazards, safety measures, alternative tool routing, file/live mode behaviors, backup semantics, and tracked-change limitations. Since an output schema exists, enumerating return values is unnecessary; it even mentions the key returned field, replaced_text.

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?

Despite 0% schema description coverage, the description gives operational meaning to index, expect, backup, new_text, and the file/live distinction. The main gap is that it never specifies the indexing base for the index parameter or the accepted values/meaning of the live parameter beyond general live-editing context.

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 opens with a specific verb and resource: 'Replace one paragraph's full text', and adds preservation constraints ('keeping style and base formatting'). It also distinguishes itself from search_and_replace by naming the exact alternative, so an agent can tell them apart.

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

Usage Guidelines5/5

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

It explicitly states when to use search_and_replace instead ('text-anchored replacement immune to index shifts') and frames this tool as the fallback when search_and_replace's length limit is exceeded. The expect parameter is also recommended as a safety mechanism against index-shift mistakes.

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/nometalalchemist/KitchenSink4Word'

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