Skip to main content
Glama

Replace text in a Docmost page

replace_page_text
Destructive

Replaces exact text in a Docmost page while preserving comments, mentions, and formatting, and merges with concurrent edits; rewrite the full body in Markdown only when needed.

Instructions

Replaces an exact piece of text in a page, changing plain text in the live document so it merges with anyone editing and keeps comments, mentions and formatting, with Docmost saving it within 45 seconds, and rewriting the whole body from Markdown only when the change needs Markdown.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pageId": "<pageId>",
      "oldText": "<oldText>",
      "newText": "<newText>"
    },
    "name": "replace_page_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageIdYesPage id, slug id, or the full page URL copied from the browser.
newTextYesReplacement Markdown; an empty string deletes oldText.
oldTextYesExact text to replace, copied from get_page output; must match once unless replaceAll is set.
replaceAllNoReplace every occurrence of oldText; defaults to false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Goes well beyond the annotations (destructiveHint, openWorldHint, idempotentHint=false) by disclosing that the edit merges with concurrent editors, preserves comments/mentions/formatting, and may take up to 45 seconds to persist. That timing and concurrency detail is exactly what an agent needs before firing a destructive mutation, though it does not say what happens on a failed or ambiguous oldText match, nor which formatting the Markdown-fallback path risks losing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded in the first clause, which is good, but the rest is a single run-on sentence stacking concurrency, preservation, timing, and fallback semantics with comma splices and an awkward 'changing plain text ... so it merges'. It earns its content but would read far better as two or three short sentences.

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

Completeness4/5

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

For a destructive, non-idempotent mutation with no output schema, the description covers the important ground: concurrency, preservation of annotations and formatting, eventual-consistency timing, and the Markdown fallback. Missing only failure behavior and the destructive blast radius on the Markdown rewrite path.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already explains pageId formats, the empty-string delete convention, the single-match rule, and replaceAll. The description only restates 'exact piece of text' and the Markdown nature of newText, adding no syntax or formatting guidance beyond structured fields, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Replaces an exact piece of text in a page'. The mention of 'rewriting the whole body from Markdown only when the change needs Markdown' implicitly separates it from a whole-page update tool, but it never names update_page, so sibling differentiation is inference rather than statement.

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 — use this for a surgical text swap rather than a full-page rewrite — and the schema note 'copied from get_page output' hints at a read-then-replace workflow. However there is no explicit when-to-use/when-not statement and no named alternative such as update_page for larger rewrites.

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