Skip to main content
Glama

apply_document_update

DestructiveIdempotent

Save a change shown with preview_document_update, after the user agreed to it, or publish the document as previewed (publish=). Replaces or removes the stored section or block, or replaces chart data or the Visual Story; the previous document stays in its version history in Clarifo (the previous Visual Story in the item, one step back).

Pass exactly the arguments of the preview plus its base_version and preview_hash. If the document changed since the preview the call is refused (version_conflict): read it and preview again.

Args: item_id: As in the preview. base_version: base_version from the preview. preview_hash: preview_hash from the preview. idempotency_key: Optional; leave it out. Clarifo recognises a repeated identical request by its content. Give one only to retry this same request. section_id: As in the preview. markdown: As in the preview. operation: As in the preview. sources: As in the preview. companies: As in the preview. workspace_id: Optional; the document's workspace. block_id: As in the preview. visual_id: As in the preview. visual_data: As in the preview. visual_story: As in the preview. publish: As in the preview: "public" or "private". Publishes through Clarifo's own Publish (plan rules, content review); tell the user the public_url.

Returns: {"status": "document_updated", "content_version", "editor_url"} or {"status": "document_published", "public_url", "visibility"} or {"error", "failure_kind"}.

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": {
      "item_id": "<item_id>",
      "base_version": "<base_version>",
      "preview_hash": "<preview_hash>"
    },
    "name": "apply_document_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
seoNo
item_idYes
publishNo
sourcesNo
block_idNo
markdownNo
companiesNo
operationNoreplace
visual_idNo
section_idNo
visual_dataNo
base_versionYes
preview_hashYes
visual_storyNo
workspace_idNo
idempotency_keyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that existing sections, blocks, chart data or Visual Story are replaced or removed, that the prior state is recoverable from version history (one step back for the Visual Story), and that publishing flows through Clarifo's own Publish step with plan rules and content review. The base_version/preview_hash concurrency guard and the version_conflict refusal are behavior an agent could not infer from readOnlyHint/destructiveHint alone, and nothing contradicts the declared destructive and idempotent hints.

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

Conciseness4/5

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

The workflow and conflict-handling rules are front-loaded in the first two paragraphs, which is the right structure. The long Args list is repetitive and adds bulk, though each line does at least repeat the 'copy it exactly' rule; the Returns block is redundant given the output schema but harmless.

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 16-parameter mutation, the description supplies the full call sequence, the concurrency contract, the conflict recovery, and the safety story around publish and version history. The main remaining gap is the undocumented seo parameter and the unstated semantics of operation values, but the 'use exactly the preview's arguments' rule largely compensates by routing the agent through preview_document_update.

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?

With 0% schema description coverage, the Args block carries the load, but nine of the sixteen parameters are described only as 'As in the preview', which tells the agent where to get the value, not what the value means. base_version, preview_hash, idempotency_key, workspace_id and publish are genuinely explained, but the meaning of operation values is left implicit and the seo parameter is never mentioned at all.

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?

Opens with a specific verb and resource ('Save a change shown with preview_document_update') and explicitly names both modes: applying a previewed edit or publishing it. It also names the companion tool preview_document_update, so an agent can distinguish the two without inspecting either schema.

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?

Gives the exact precondition (only after the preview and the user's agreement), the alternative route (publish= as previewed), and the recovery path on failure (on version_conflict, read the document and preview again). The retry rule for idempotency_key — leave it out unless retrying this same request — is also explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.