Skip to main content
Glama

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
NameRequiredDescriptionDefault
commentsYesMessage for this publish
contentSiteIdYesContent Site ID
isApprovedYesIs the publish approved
previewUrlNoPreview URL for the staging site
publishAtNoWhen to publish the staging site
stagingSiteIdYesStaging Site ID

Implementation Reference

  • 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, }; } }
  • 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, }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Headlesshost/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server