Skip to main content
Glama

Edit page

apply_ops

Applies edit-ops to one page, all or nothing: one new version (older ones kept), none when nothing changes (unchanged: true). Each op is an object named by its "op" field: insert{parentId,index,node} (ids you pick, unique on the page) | remove{nodeId} | move{nodeId,parentId,index} | setProps{nodeId,props} | setRichText{nodeId,doc} | inside a text without resending it: addMark{nodeId,match,occurrence?,mark} / removeMark{nodeId,match,occurrence?,markType} / replaceText{nodeId,match,occurrence?,text} / setBlock{nodeId,block,type?,attrs?} (heading, list, quote) — match ≤500, text ≤5000 characters | setStyle{nodeId,style} | setSeo{seo:{title?,description?,ogImageAssetId?,noindex?,hideFromSiteSearch?}} | setAccess{access} | setNodeFields{nodeId,fields}: image {assetId,alt,caption}, button {label,href}. baseVersion: the page's current version (get_page or describe_layout); stale = 409, nothing written. A 422 names the op: failedOp {index, op, field}. Answers the new version; warnings (saved anyway): unreadable text colours, a setSeo title over 70 / description over 160 characters trimmed there, quoting what was cut. Node shapes by example: describe_element_type (area design). Columns: place_block_beside (area design) / resize_cell (area design) / join_cells (area design) / edit_element keep rows totalling 12. Element fields, rich text, links, anchors, every limit: Full reference: get_reference {topic:"ops"}.

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": {
      "siteId": "<siteId>",
      "pageId": "<pageId>",
      "baseVersion": "<baseVersion>",
      "ops": "<ops>"
    },
    "name": "apply_ops"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYesEdit-op objects
pageIdYesPage id, or a design: "product-template", "cart-template", "post-template", "site-header", "site-footer"
siteIdYesSite id (from list_sites)
baseVersionYesThe page version this edit is based on

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare a non-read-only, non-idempotent, non-destructive edit operation; the description adds substantial context about atomicity, version retention, unchanged results, 409 stale-version behavior, 422 failedOp reporting, and warnings. It also explains that older versions are kept, which supports the non-destructive annotation despite remove ops.

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 behavior is front-loaded, and the text is dense without obvious filler. However, the long pipe-delimited op catalog and cryptic cross-references make it a hard-to-scan wall of text that would benefit from bullet structure.

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 complex batch mutation tool with no output schema, the description covers return behavior, error semantics, warnings, versioning, limits, op shapes, and reference pointers. Nothing essential for correct invocation appears missing.

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 coverage is 100%, the schema only describes ops generically as "Edit-op objects." The description supplies the actual op catalog, required fields per op, text and match length limits, baseVersion semantics, and pageId template examples—meaning far beyond the structured 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, resource, and scope: "Applies edit-ops to one page, all or nothing." The atomicity and versioning framing make it clearly distinct from single-element editing tools.

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 clear routing context: baseVersion comes from get_page or describe_layout, column operations should use place_block_beside/resize_cell/join_cells/edit_element, and full details live in get_reference {topic:"ops"}. It does not explicitly say when to prefer this tool over update_page or edit_element, but the surrounding context is strong.

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.

Resources