Skip to main content
Glama

Replace Page Json

replace_page_json
Destructive

Replace a Docmost page body with ProseMirror JSON to keep rich formatting, tables, columns, mentions, and comments; validate against the editor schema and preview changes with dry-run.

Instructions

Replace a whole page body with a ProseMirror JSON document, as get_page with format='json' returns it. Unlike Markdown this keeps everything Docmost can show: colors, merged table cells, columns, diagrams, mentions, comment highlights. Read the page as JSON first, change it and send the complete document. It is checked against Docmost's editor schema before anything is written, refused while someone else is editing the page, and the previous body is saved as a snapshot. With dry_run=true nothing is written; the result lists any problems and shows the change as a Markdown diff.

Input Schema

NameRequiredDescriptionDefault
pageYesPage id, slug id or Docmost page URL.
dry_runNoOnly show the change as a diff; write nothing.
documentYesThe ProseMirror document: {'type': 'doc', 'content': [...]}.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the destructiveHint=true annotation: it discloses editor-schema validation before any write, refusal while another user is editing the page, automatic snapshot of the previous body, and the exact dry_run behavior (nothing written, problems listed, Markdown diff returned). These are precisely the operational facts an agent needs before invoking a destructive whole-document overwrite.

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?

Four tight sentences: what it does, why JSON is chosen, the round-trip procedure, and the safety/preview guarantees. Nothing repeats, and the core operation is front-loaded.

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?

Complete for a destructive, nested-payload mutation: validation, concurrency refusal, snapshotting, and a safe dry-run path are all covered, and an output schema exists so return values need not be explained. No gap remains for correct invocation.

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 coverage is 100%, so page (id/slug/URL), dry_run (boolean with diff semantics), and document (ProseMirror shape) are already documented. The description mostly restates the round-trip origin of 'document' and the purpose of dry_run without adding syntax or constraints beyond the schema.

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?

States a specific verb and resource ('Replace a whole page body') plus the exact payload format (ProseMirror JSON), and contrasts it with the Markdown-based path. An agent can immediately distinguish it from update_page, replace_section, and rename_page without opening any schema.

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

Usage Guidelines4/5

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

Gives an explicit workflow: read the page as JSON via get_page with format='json', modify, and send the complete document, plus the dry_run preview path. It does not name the sibling tools it replaces (replace_section, update_page) or state when to prefer a partial-section edit instead, so it stops short of the top band.

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