x
This commit is contained in:
1 parent
c1c3a43d7d
commit
a5f6e3171b
11 files changed
+351
-13
No files matched your search
@@ -213,6 +213,8 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
title: { type: "string", description: "Title of the page" },
|
||||
slug: { type: "string", description: "Unique slug identifier (e.g. about-us)" },
|
||||
isPublished: { type: "boolean", description: "Publish status" },
|
||||
status: { type: "string", description: "Publish status (e.g. 'published' or 'draft')" },
|
||||
metadata: { type: "object", description: "SEO metadata" },
|
||||
id: { type: "number", description: "Numeric page ID (if updating existing page)" }
|
||||
},
|
||||
required: ["title", "slug"]
|
||||
@@ -225,12 +227,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
type: "object",
|
||||
properties: {
|
||||
pageId: { type: "number", description: "The numeric ID of the page" },
|
||||
type: { type: "string", description: "Block type (e.g. HERO, ANNOUNCEMENT_BAR, NEWSLETTER, EDITORIAL_TILE, EDITORIAL_CAROUSEL, PRODUCTS, CATEGORIES, TEXT, BANNER)" },
|
||||
type: { type: "string", description: "Block type (e.g. HERO, ANNOUNCEMENT_BAR, NEWSLETTER, EDITORIAL_TILE, EDITORIAL_CAROUSEL, PRODUCTS, CATEGORIES, TEXT, BANNER, HERO_ARTICLE, RICH_TEXT, SCENT_NOTES_BREAKDOWN, QUOTE_CALLOUT, PRODUCT_CAROUSEL)" },
|
||||
order: { type: "number", description: "Display order sequence (starts at 1)" },
|
||||
payload: { type: "object", description: "The JSON payload matching the section type rules" },
|
||||
isActive: { type: "boolean", description: "Initial active state" }
|
||||
},
|
||||
required: ["pageId", "type", "order", "payload"]
|
||||
required: ["pageId", "type", "payload"]
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -386,8 +388,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
const payload: any = {
|
||||
title: params.title,
|
||||
slug: params.slug,
|
||||
isPublished: params.isPublished !== false
|
||||
};
|
||||
if (params.isPublished !== undefined) payload.isPublished = params.isPublished;
|
||||
if (params.status !== undefined) payload.status = params.status;
|
||||
if (params.metadata !== undefined) payload.metadata = params.metadata;
|
||||
if (params.id) {
|
||||
payload.id = params.id;
|
||||
}
|
||||
@@ -395,12 +399,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
|
||||
}
|
||||
case "add_page_section": {
|
||||
const payload = {
|
||||
const payload: any = {
|
||||
type: params.type,
|
||||
order: params.order,
|
||||
payload: params.payload,
|
||||
isActive: params.isActive !== false
|
||||
};
|
||||
if (params.order !== undefined) payload.order = params.order;
|
||||
const res = await api.post(`/pages/${params.pageId}/sections`, payload);
|
||||
return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user