Unpublish Page
unpublish_pageUnpublish a page from a website by specifying its website ID and page ID.
Instructions
Unpublish a page from a website.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| website_id | Yes | The website ID | |
| page_id | Yes | The page ID to unpublish |
Implementation Reference
- server/index.js:661-676 (registration)Registration of the 'unpublish_page' tool using server.registerTool() with its name, metadata, input schema, and handler callback.
server.registerTool( "unpublish_page", { title: "Unpublish Page", description: "Unpublish a page from a website.", inputSchema: { website_id: z.string().describe("The website ID"), page_id: z.string().describe("The page ID to unpublish"), }, annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false }, }, async ({ website_id, page_id }) => { const data = await apiCall(`/v1/workspace/website/${website_id}/pages/${page_id}/unpublish`, "POST"); return { content: [{ type: "text", text: JSON.stringify(data?.result ?? data, null, 2) }] }; } ); - server/index.js:666-669 (schema)Input schema for unpublish_page: requires website_id (string) and page_id (string), validated with Zod.
inputSchema: { website_id: z.string().describe("The website ID"), page_id: z.string().describe("The page ID to unpublish"), }, - server/index.js:672-676 (handler)Handler function that calls apiCall to POST to /v1/workspace/website/{website_id}/pages/{page_id}/unpublish and returns the result.
async ({ website_id, page_id }) => { const data = await apiCall(`/v1/workspace/website/${website_id}/pages/${page_id}/unpublish`, "POST"); return { content: [{ type: "text", text: JSON.stringify(data?.result ?? data, null, 2) }] }; } ); - server/index.js:112-123 (helper)The apiCall helper function that the unpublish_page handler uses to make authenticated HTTP requests to the backend API.
async function apiCall(path, method, body) { const url = `${BASE_URL}${path}`; const res = await fetch(url, { method, headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json", }, ...(body ? { body: JSON.stringify(body) } : {}), }); return res.json(); }