Skip to main content
Glama

set_paragraph_text

Replace a paragraph's text without losing its formatting. Use location to target a paragraph, pass an 'expect' substring to confirm the right one, and get automatic backup with atomic saves.

Instructions

Replace one paragraph's full text, keeping style and base formatting; address it with a location object ({paragraph: N}, {search: ...}, {outline: ...}). Indices shift after edits, so pass expect (a substring the target must contain) to refuse instead of hitting the wrong paragraph; verify the returned replaced_text. Auto-backup in file mode (backup=False skips rotation); atomic validated save. Edits go live on open documents (serialized); tracked-revision paragraphs refuse live. For batches, use apply_edits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
liveNoauto
backupNo
expectNo
locationYes
new_textYes
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint=false annotation, the description discloses index-shifting risk, the refusal-on-mismatch behavior of expect, auto-backup behavior, atomic validated saving, live-edit/serialization semantics, and refusal for tracked-revision paragraphs. It aligns with the annotation (write operation) and adds substantial behavioral context.

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 earns its place: purpose, addressing, safety, backup, live behavior, and batch routing. No filler or repetition of schema fields.

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?

For a concise mutation tool it covers risk, failure modes, backup, transaction safety, live-document implications, and the batch alternative; it also references the returned replaced_text for verification. This is a complete operational picture, especially with an output schema available.

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

Parameters5/5

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

Although schema description coverage is 0%, the description compensates by explaining the location object variants, expect as a required substring guard, backup behavior, and live-edit semantics. new_text and file_path are self-evident, so the most ambiguous parameters are meaningfully documented.

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 the preserving condition 'keeping style and base formatting.' This clearly differentiates it from sibling formatting tools like set_paragraph_format and batch tools like apply_edits.

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 gives direct usage instructions for locating the target ('address it with a location object'), explains the safety condition for using expect, and explicitly routes batch work to apply_edits. This tells an agent exactly when and how to use the tool versus alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.