unpublish_page
Unpublish a page to take it offline, removing it from public access on your website.
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:580-583 (handler)The handler function for the 'unpublish_page' tool. It calls the API endpoint to unpublish a page 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, null, 2) }] }; } - server/index.js:575-578 (schema)Input schema for 'unpublish_page' tool: website_id (string) and page_id (string).
{ website_id: z.string().describe("The website ID"), page_id: z.string().describe("The page ID to unpublish"), }, - server/index.js:572-584 (registration)Registration of the 'unpublish_page' tool using server.tool() with metadata (title, destructiveHint, etc.) and the handler.
server.tool( "unpublish_page", "Unpublish a page from a website.", { website_id: z.string().describe("The website ID"), page_id: z.string().describe("The page ID to unpublish"), }, { title: "Unpublish Page", 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, null, 2) }] }; } ); - server/index.js:112-123 (helper)The apiCall helper function used by the handler 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(); }