update_staging_site
Updates staging site details including name, locale, URLs, and content properties for website testing and development environments.
Instructions
Update staging site information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Staging site content | |
| contentSiteId | Yes | Content Site ID | |
| guideUrl | No | Staging site guide URL | |
| isHead | Yes | Is the default staging site | |
| locale | No | Staging site default locale | |
| name | No | Staging site name | |
| stageUrl | No | Staging site stage URL | |
| stagingSiteId | Yes | Staging Site ID |
Implementation Reference
- src/index.ts:967-997 (handler)Handler function that constructs a payload from input parameters and sends a PUT request to the Headlesshost API to update the specified staging site.async ({ contentSiteId, stagingSiteId, name, locale, isHead, content, stageUrl, guideUrl }) => { try { const payload: any = {}; if (name) payload.name = name; if (locale) payload.locale = locale; if (isHead) payload.isHead = isHead; if (content) payload.content = content; if (stageUrl) payload.stageUrl = stageUrl; if (guideUrl) payload.guideUrl = guideUrl; const response: AxiosResponse<ApiResponse> = await apiClient.put(`/tools/content-sites/${contentSiteId}/staging-sites/${stagingSiteId}`, 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:956-965 (schema)Zod input schema defining required contentSiteId and stagingSiteId, and optional fields for updating staging site properties.inputSchema: { contentSiteId: z.string().describe("Content Site ID"), stagingSiteId: z.string().describe("Staging Site ID"), name: z.string().optional().describe("Staging site name"), locale: z.string().optional().describe("Staging site default locale"), isHead: z.boolean().describe("Is the default staging site"), content: z.record(z.any()).optional().describe("Staging site content"), stageUrl: z.string().optional().describe("Staging site stage URL"), guideUrl: z.string().optional().describe("Staging site guide URL"), },
- src/index.ts:951-999 (registration)MCP tool registration call that registers the 'update_staging_site' tool with its schema and handler on the McpServer instance.server.registerTool( "update_staging_site", { title: "Update Staging Site", description: "Update staging site information", inputSchema: { contentSiteId: z.string().describe("Content Site ID"), stagingSiteId: z.string().describe("Staging Site ID"), name: z.string().optional().describe("Staging site name"), locale: z.string().optional().describe("Staging site default locale"), isHead: z.boolean().describe("Is the default staging site"), content: z.record(z.any()).optional().describe("Staging site content"), stageUrl: z.string().optional().describe("Staging site stage URL"), guideUrl: z.string().optional().describe("Staging site guide URL"), }, }, async ({ contentSiteId, stagingSiteId, name, locale, isHead, content, stageUrl, guideUrl }) => { try { const payload: any = {}; if (name) payload.name = name; if (locale) payload.locale = locale; if (isHead) payload.isHead = isHead; if (content) payload.content = content; if (stageUrl) payload.stageUrl = stageUrl; if (guideUrl) payload.guideUrl = guideUrl; const response: AxiosResponse<ApiResponse> = await apiClient.put(`/tools/content-sites/${contentSiteId}/staging-sites/${stagingSiteId}`, payload); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } } );