Skip to main content
Glama

Edit a catalog

edit_catalog
Destructive

Apply targeted changes to an existing catalog: addProducts, removeProduct, addPage, removePage, setGrid, reorderPages, setCategory, editProduct, addBlock, editBlock, removeBlock, setProductCellStyle, setHeader, setFooter, setPageStyle. EVERY edit here is scoped to THIS CATALOG, never to the merchant's store: editProduct changes the title, price, sku, description, vendor or image as this catalog shows them, and the store keeps its own values — so a price or title changed "in the catalog" is editProduct, with no change in the store needed. A value edited this way is kept on later syncs, because it is treated as the merchant's deliberate wording rather than stale data. foldsquare://schemas/catalog-edit-ops.json lists exactly which fields each op accepts. Text on a page, and header/footer text, may carry dynamic fields written bare in the html — {{shop.name}}, {{shop.url}}, {{shop.email}}, {{shop.phone}}, {{shop.address}}, {{page.number}}, {{page.category}}, {{general.current_year}} — and they are stored as live fields, updated wherever the catalog is shown. Product fields belong in the tiles, through a details block. Page blocks — cover headings, shapes, pictures — are listed by get_catalog under blocks with ids such as "p1-text-2" whether or not the template gave them a key; editBlock changes one through its html, which carries its styling. THE LISTING DESIGN — what a merchant sees inside every product tile (the photo region, the title, "Product Code:", the price box, the description) — is reported by get_catalog under productCell.blocks, each with an id such as "photos-1", "details-2" or "shp-…", and changed with editBlock and that id: lines for a details block (text and product fields with sizes, rather than html), photos for the photo region (layout, fit, thumbnails), fill for a shape, style for a block's background or border. Font sizes are px at PRINT resolution, not web sizes; get_catalog reports the sizes the design already uses. addBlock with inProductCells: true adds a block to the tiles; removeBlock takes one away. A design edit lands on EVERY tile that renders the design, so it shows throughout the catalog; productId limits it to one product's tile, which then stops following the catalog design. Positions inside a tile are percentages of the tile: at.area, at.relativeToBlock with a sibling block id, or an explicit at.box. setProductCellStyle styles the tiles themselves (border, background, padding). Which fields a tile shows changes through its details block (editBlock with lines); setFields is retired and always refused. Edits touch only what they name, so work the merchant did in the visual editor survives — but an editor tab open during the edit overwrites it on its next autosave unless it is reloaded. Page indexes come from get_catalog's pages (zero-based; not positions in document.pages), product ids from its document, block ids from blocks and productCell. A CUSTOM GRID — any number of product tiles across and down, within 10 x 50, as the editor's grid panel allows; the template sets how tiles look, not how many fit on a page — is setGrid, on any page: on a products page it re-lays-out the products; on a page with no products yet it lays out that grid of empty slots for addProducts with that page to fill; and a blank page, a cover or any other kind of page simply becomes a products page with that grid (what was on it is removed, which the confirmation says) — never refuse a grid because of the kind of page it is asked for. A NEW page on a custom grid is addPage { kind: "products", grid } followed by addProducts with its page. Operations that re-lay-out or delete a page are applied only with confirm: true; without it nothing changes and the answer lists the consequences under requiresConfirmation, for the merchant to approve. Results name a page as "page 6 (index 5)": the index is for the next op, the page number is what to say to the merchant. The first edit of a catalog in a while returns livePreviewUrl, a page that reloads by itself as edits land; the edits that follow do not repeat it.

Input Schema

NameRequiredDescriptionDefault
opsYesPatch operations, applied in order. Each is { op, ...arguments }. A rebuild discards everything the merchant changed in the editor; these ops keep it. A WHOLE COLLECTION is ONE op: { op: "addProducts", collectionId: <id> }. The server resolves the products, names the run after the collection and starts it on a new page at the end, matching the grid and blocks of the runs already there. The same built out of addPage + setCategory + setGrid + addProducts needs page numbers computed by hand, and a wrong one renames an existing collection's pages instead of the new ones. A hand-picked selection rather than a whole collection is `productIds`, with `category` set to name it. A run added from a collection is LINKED to it: get_catalog reports its `collectionId`, and `removeProduct` takes an optional `collectionId` to remove from that run only. `setCategory` renames a page's collection label, `editProduct` changes what one product shows, and `addBlock`/`editBlock`/`removeBlock` place text, image and shape blocks on a page — positioned by a named page area ("bottom-left") or against a product ({ relativeTo: <productId>, side: "below" }) — or, with `inProductCells` / a listing-design block id from get_catalog's `productCell`, inside every product tile. `setHeader`/`setFooter` change the running header and footer text — catalog-wide by default, or `scope: <pageIndex>` for one page; `visible` shows or hides it without changing what it says, and `inherit: true` puts a page back on the catalog default. Block ids and the current header/footer html come from get_catalog.
confirmNotrue applies a re-layout or deletion that an earlier answer listed under requiresConfirmation.
catalogIdYesCatalog id, as returned by list_catalogs

Output Schema

NameRequiredDescriptionDefault
appliedYes
changesNoWhat each op did
warningsNo
confirmWithNoThe arguments that carry the change out once the merchant agrees
schemaIssuesNoMalformed ops; nothing was applied
livePreviewUrlNoOn the first edit in a while: a page that reloads as edits land
requiresConfirmationNoPresent when nothing was changed: the consequences to show the merchant before calling again with confirm: true

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only give readOnly=false, destructive=true, idempotent=false; the description goes far beyond by naming what is destroyed (setGrid on a blank/cover page removes what was on it), that destructive ops require confirm:true and otherwise return requiresConfirmation, that an open editor tab overwrites the edit on its next autosave, and that only named fields are touched while catalog-scoped edits survive later syncs. It also discloses the first-edit-only `livePreviewUrl` return behavior, which annotations cannot convey.

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 op list is appropriately front-loaded, but what follows is a single dense block of prose mixing the store-vs-catalog boundary, dynamic fields, block ids, grid rules, confirmation, and preview URLs with no internal structure. Nearly every sentence carries real information, yet the all-caps emphasis scattered mid-paragraph and the sheer length make it harder to scan than it needs to be.

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 destructive multi-op patch tool, the definition covers the gaps an agent would otherwise hit: page index vs. displayed page number ('page 6 (index 5)'), grid bounds (10 x 50), collection-linked runs and removeProduct by collectionId, header/footer scoping, and confirmation semantics. With an output schema present, it correctly stops short of explaining return shapes beyond the one non-obvious field (livePreviewUrl).

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

Parameters4/5

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

Schema coverage is 100% and the ops schema already carries heavy prose, so the baseline is 3; the description still adds meaning the schema does not duplicate cleanly, such as `productId` limiting a design edit to one tile that 'then stops following the catalog design', `at.area`/`at.relativeToBlock`/`at.box` being percentages of the tile, and `inProductCells: true` adding a block to every tile. It also points to foldsquare://schemas/catalog-edit-ops.json for per-op field lists rather than restating them, which is a useful pointer but leaves per-op argument semantics delegated.

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 ('Apply targeted changes to an existing catalog') and then enumerates the full op vocabulary (addProducts, setGrid, editBlock, etc.), so an agent knows exactly what surface this tool covers. It also draws a sharp boundary that no sibling covers: 'EVERY edit here is scoped to THIS CATALOG, never to the merchant's store,' which distinguishes it from update_product and update_catalog.

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 explicit when-to-use routing: which fields a tile shows changes through editBlock with `lines` and '`setFields` is retired and always refused'; a custom grid is always `setGrid` and 'never refuse a grid because of the kind of page it is asked for'; a new grid page is addPage followed by addProducts. It also states the prerequisite for ids ('Page indexes come from get_catalog's `pages` ... block ids from `blocks` and `productCell`') and the confirm:true gate for re-layout/deletion.

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