Skip to main content
Glama
WebCake Landing MCP

WebCake Landing MCP

by vuluu2k

patch_page

Destructive

Edit a live WebCake page or cached draft by element id using targeted operations; validate merged changes and preview or save them without resending the full source.

Instructions

Edits a page by element id without sending the whole source. The target is either a live page (page_id) or a cached draft (draft_id) returned by a failed or dry-run create_page, add_section or update_page call. Ops: {op:'update', id, type?, specials?, styles?:{desktop?,mobile?}, config?:{desktop?,mobile?}, events?, properties?} shallow-merges fields (op defaults to 'update'; it cannot delete existing keys), {op:'replace', id, element} swaps the node, {op:'remove', id} deletes it (events elsewhere that targeted it are reported in dangling_events), {op:'add', parent_id, element} appends a child to a container; element may be sparse. {op:'move', id, parent_id?, index?, desktop?:{left?,top?}, mobile?:{left?,top?}} reparents and/or reorders (z-order = child order), keeping the element visually in place unless left/top are given. {op:'duplicate', id, parent_id?, offset?:{desktop?:{x,y},mobile?:{x,y}}, count?} deep-copies with fresh unique ids (internal event targets remapped); copy i is shifted by offset×i. {op:'style', id|match, desktop?:{…}, mobile?:{…}} merges styles. update/style/remove accept match:{type?, text?, section_id?, within?} instead of id (text = case-insensitive substring, tags stripped; within = a container id) and apply to every match, refused above limit (default 50); matched_ids are reported. The server loads the source, applies the ops, validates the whole merged tree (errors block the save) and saves: a live page is updated in place, a create draft becomes a new page, a section draft is appended, and an update draft is re-saved. With a draft_id and no patches, the cached draft is committed as-is (the retry after a timeout). dry_run defaults to true (load, merge, validate, preview; no write); dry_run:false saves. Requires Webcake credentials; a page_id patch reads the live page, so it needs them even on a dry run.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "patch_page"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoDefault false. Only meaningful when committing an 'update' draft: true saves the cached snapshot even though the page changed outside this session, discarding those changes. A page_id patch never needs it — it merges into the tree it just read.
dry_runNoDefault TRUE — load, merge, validate and preview the resulting save WITHOUT writing. Set false to actually save.
page_idNoA live page id to edit (must be owned by the account). Provide page_id OR draft_id; with a sections or update draft_id, page_id overrides the stored target page.
patchesNoOne op object or an array of them (object/array or JSON string). Each targets an element by id: {op:'update',id,type?,specials?,styles?:{desktop?,mobile?},config?:{desktop?,mobile?},events?,properties?} merges fields into the element (op may be omitted; `type` changes the element type; a merge cannot delete an existing key, so schema 'must NOT have additional properties' errors are fixed with op:'replace' and a clean node); {op:'replace',id,element} swaps the node; {op:'remove',id} deletes it; {op:'add',parent_id,element} appends a child to a container; {op:'move',id,parent_id?,index?,desktop?:{left,top},mobile?:{left,top}}; {op:'duplicate',id,parent_id?,offset?:{desktop?:{x,y},mobile?:{x,y}},count?}; {op:'style',id|match,desktop?,mobile?}. update/style/remove take match:{type?,text?,section_id?,within?} + limit? (default 50) instead of id. `element` may be a sparse node (id/type/styles/specials/events); omitted boilerplate is filled from factory defaults. Empty or omitted with a draft_id: the cached draft is committed as-is.
draft_idNoCommit or fix a CACHED source: from create_page (failed/timed-out → new page created once valid), add_section (dry_run or failure → sections appended), or update_page/live-page patch (timed-out/failed → updatePageSource retried). The originating tool's error/dry_run response returns draft_id. Provide page_id OR draft_id. Empty/omitted patches = commit the cached draft as-is (the RETRY PATH after a timeout).
organization_idNoOrganization the page(s) belong to: an organization id, or 'personal' (= no organization). Settle it first (list_organizations; ask the user when the account has 2+). When omitted: the org remembered for this page_id (from get_page), else WEBCAKE_ORG_ID / x-webcake-org-id, else the account's only organization, else ok:false reason:'organization_required' with the list.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.16.1
    • addedInput schema / properties / organization_id
      Added value: +{
      +  "description": "Organization the page(s) belong to: an organization id, or 'personal' (= no organization). Settle it first (list_organizations; ask the user when the account has 2+). When omitted: the org remembered for this page_id (from get_page), else WEBCAKE_ORG_ID / x-webcake-org-id, else the account's only organization, else ok:false reason:'organization_required' with the list.",
      +  "type": "string"
      +}
  2. Changed1 schema field changedv1.13.6
    • changedInput schema / properties / patches / description
      Previous value: -"One op object or an array of them (object/array or JSON string). Each targets an element by id: {op:'update',id,type?,specials?,styles?:{desktop?,mobile?},config?:{desktop?,mobile?},events?,properties?} merges fields into the element (op may be omitted; `type` changes the element type; a merge cannot delete an existing key, so schema 'must NOT have additional properties' errors are fixed with op:'replace' and a clean node); {op:'replace',id,element} swaps the node; {op:'remove',id} deletes it; {op:'add',parent_id,element} appends a child to a container. `element` may be a sparse node (id/type/styles/specials/events); omitted boilerplate is filled from factory defaults. Empty or omitted with a draft_id: the cached draft is committed as-is."New value: +"One op object or an array of them (object/array or JSON string). Each targets an element by id: {op:'update',id,type?,specials?,styles?:{desktop?,mobile?},config?:{desktop?,mobile?},events?,properties?} merges fields into the element (op may be omitted; `type` changes the element type; a merge cannot delete an existing key, so schema 'must NOT have additional properties' errors are fixed with op:'replace' and a clean node); {op:'replace',id,element} swaps the node; {op:'remove',id} deletes it; {op:'add',parent_id,element} appends a child to a container; {op:'move',id,parent_id?,index?,desktop?:{left,top},mobile?:{left,top}}; {op:'duplicate',id,parent_id?,offset?:{desktop?:{x,y},mobile?:{x,y}},count?}; {op:'style',id|match,desktop?,mobile?}. update/style/remove take match:{type?,text?,section_id?,within?} + limit? (default 50) instead of id. `element` may be a sparse node (id/type/styles/specials/events); omitted boilerplate is filled from factory defaults. Empty or omitted with a draft_id: the cached draft is committed as-is."
  3. Changed3 schema fields changedv1.5.11
    • changedInput schema / properties / page_id / description
      Previous value: -"Edit a LIVE page by id (from create_page, list_pages, or find_pages; must be owned by the account). Provide page_id OR draft_id. For a sections or update draft_id you may also pass page_id here to override the stored page target."New value: +"A live page id to edit (must be owned by the account). Provide page_id OR draft_id; with a sections or update draft_id, page_id overrides the stored target page."
    • addedInput schema / properties / patches / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": {},
      +    "type": "object"
      +  },
      +  {
      +    "items": {
      +      "additionalProperties": {},
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / patches / description
      Previous value: -"One op object or an array of them (object/array or JSON string). Each targets an element by id: {op:'update',id,type?,specials?,styles?:{desktop?,mobile?},config?:{desktop?,mobile?},events?,properties?} merges fields into the element (op may be omitted; set `type` to fix a wrong element type; update MERGES — it cannot DELETE an existing/stray key, so 'must NOT have additional properties' errors need op:'replace' with a clean node); {op:'replace',id,element} swaps the node; {op:'remove',id} deletes it; {op:'add',parent_id,element} appends a child to a container. `element` may be a SPARSE node (id/type/styles/specials/events only) — the server hydrates omitted boilerplate from factory defaults. OMIT (or pass empty array) when draft_id is given and you just want to commit/retry the cached draft as-is."New value: +"One op object or an array of them (object/array or JSON string). Each targets an element by id: {op:'update',id,type?,specials?,styles?:{desktop?,mobile?},config?:{desktop?,mobile?},events?,properties?} merges fields into the element (op may be omitted; `type` changes the element type; a merge cannot delete an existing key, so schema 'must NOT have additional properties' errors are fixed with op:'replace' and a clean node); {op:'replace',id,element} swaps the node; {op:'remove',id} deletes it; {op:'add',parent_id,element} appends a child to a container. `element` may be a sparse node (id/type/styles/specials/events); omitted boilerplate is filled from factory defaults. Empty or omitted with a draft_id: the cached draft is committed as-is."
  4. Changed1 schema field changedv1.5.2
    • addedInput schema / properties / force
      Added value: +{
      +  "description": "Default false. Only meaningful when committing an 'update' draft: true saves the cached snapshot even though the page changed outside this session, discarding those changes. A page_id patch never needs it — it merges into the tree it just read.",
      +  "type": "boolean"
      +}
  5. First observedv1.5.0

TDQS

A4.3/5.0
Behavior5/5

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

Far exceeds the annotations: it discloses that shallow merge cannot delete keys, that removed elements surface in dangling_events, that matched ids are reported, that match-based ops are refused above the limit (default 50), that validation errors block the save, and what each draft type becomes on commit. It also warns that a page_id patch reads the live page and therefore requires Webcake credentials even on a dry run — exactly the kind of hidden prerequisite that matters here.

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 purpose and target selection are front-loaded, but the middle of the description is a dense run-on enumerating every op with the same detail already present in the patches schema entry. Length is defensible for the tool's complexity, yet the duplication costs it conciseness.

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 six-parameter mutation tool with no output schema, the description covers everything an agent needs: source selection, op semantics, server-side validation, dry-run default, credential requirements, and the retry-after-timeout path. Nothing material is left unstated.

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% and the schema's patches/draft_id/force descriptions already carry the op grammar and precedence rules, so the prose largely restates them rather than adding new meaning. The useful additions (op defaults to 'update', match limit default 50) are duplicated verbatim in the schema, leaving this at baseline.

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 first sentence gives a specific verb and resource ("Edits a page by element id") plus the discriminating constraint "without sending the whole source", which cleanly separates it from the sibling update_page. The op catalogue that follows makes the tool's scope unmistakable.

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?

It states clearly when to supply page_id versus draft_id, and that an empty patch set on a draft_id is the retry path after a timeout — genuinely useful routing guidance. It never explicitly says "use update_page instead when you want to replace the whole source", so the sibling comparison is left implicit.

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