publish_staging_site
Publish a staging site to production, making it live for users with approval, scheduling, and optional preview.
Instructions
Publish a staging site to make it live
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comments | Yes | Message for this publish | |
| contentSiteId | Yes | Content Site ID | |
| isApproved | Yes | Is the publish approved | |
| previewUrl | No | Preview URL for the staging site | |
| publishAt | No | When to publish the staging site | |
| stagingSiteId | Yes | Staging Site ID |
Implementation Reference
- src/index.ts:1057-1081 (handler)Handler function that executes the publish_staging_site tool. Constructs payload from inputs and makes PUT request to API endpoint to publish the staging site, handles response or error.async ({ contentSiteId, stagingSiteId, comments, isApproved, publishAt, previewUrl }) => { try { const payload = { comments, isApproved, publishAt, previewUrl }; const response: AxiosResponse<ApiResponse> = await apiClient.put(`/tools/content-sites/${contentSiteId}/staging-sites/${stagingSiteId}/publish`, payload); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } }
- src/index.ts:1045-1056 (schema)Tool metadata and input schema using Zod validators for parameters required to publish a staging site.{ title: "Publish Staging Site", description: "Publish a staging site to make it live", inputSchema: { contentSiteId: z.string().describe("Content Site ID"), stagingSiteId: z.string().describe("Staging Site ID"), comments: z.string().describe("Message for this publish"), isApproved: z.boolean().describe("Is the publish approved"), publishAt: z.date().optional().describe("When to publish the staging site"), previewUrl: z.string().optional().describe("Preview URL for the staging site"), }, },
- src/index.ts:1043-1082 (registration)Registration of the publish_staging_site tool on the MCP server, specifying name, input schema, and handler function.server.registerTool( "publish_staging_site", { title: "Publish Staging Site", description: "Publish a staging site to make it live", inputSchema: { contentSiteId: z.string().describe("Content Site ID"), stagingSiteId: z.string().describe("Staging Site ID"), comments: z.string().describe("Message for this publish"), isApproved: z.boolean().describe("Is the publish approved"), publishAt: z.date().optional().describe("When to publish the staging site"), previewUrl: z.string().optional().describe("Preview URL for the staging site"), }, }, async ({ contentSiteId, stagingSiteId, comments, isApproved, publishAt, previewUrl }) => { try { const payload = { comments, isApproved, publishAt, previewUrl }; const response: AxiosResponse<ApiResponse> = await apiClient.put(`/tools/content-sites/${contentSiteId}/staging-sites/${stagingSiteId}/publish`, payload); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } } );