@bettercms-ai/mcp 0.41.0 → 0.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3171,7 +3171,20 @@ function buildToolDefs(deps) {
3171
3171
  "Edit a page",
3172
3172
  "Edit a page: title, slug, SEO metaTitle/metaDescription, publish status (draft|published), and `blockJson` (its block composition \u2014 passing it REPLACES the whole array, so read get_page first). It does NOT change the field SCHEMA \u2014 use add_page_field / set_page_content for that. Renaming the slug keeps content intact. Publishing copies the draft blocks live in the same call. " + SECTION_DOCTRINE,
3173
3173
  z.object({ pageId: z.string().min(1), title: z.string().optional(), slug: z.string().optional(), blockJson: z.array(blockObject).optional().describe("REPLACES the page's block composition"), metaTitle: z.string().optional(), metaDescription: z.string().optional(), status: z.enum(["draft", "published"]).optional() }).shape,
3174
- async (c, a) => ok("Updated page.", await data(c, "PATCH", `/management/pages/${s(a.pageId)}/meta`, { title: a.title, slug: a.slug, blockJson: a.blockJson, metaTitle: a.metaTitle, metaDescription: a.metaDescription, status: a.status }))
3174
+ async (c, a) => {
3175
+ const res = await c.fetchJSON(
3176
+ c.url(`/management/pages/${s(a.pageId)}/meta`),
3177
+ {
3178
+ method: "PATCH",
3179
+ body: JSON.stringify({ title: a.title, slug: a.slug, blockJson: a.blockJson, metaTitle: a.metaTitle, metaDescription: a.metaDescription, status: a.status })
3180
+ }
3181
+ );
3182
+ const note = res.redirectNote;
3183
+ return ok(
3184
+ note ? `Updated page. An existing redirect from ${note.source} already points to ${note.existingDestination}; it wasn't changed, so the old address does not redirect to the new one.` : "Updated page.",
3185
+ res.data
3186
+ );
3187
+ }
3175
3188
  ),
3176
3189
  // ── Code + deploy (parity with remote /mcp; needs artifact:write) ──
3177
3190
  // Both grant shapes carry that scope now; a workspace-wide one names its target per