get_staging_site
Retrieve staging site details by providing content site ID and staging site ID to access specific deployment information.
Instructions
Get staging site details by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contentSiteId | Yes | Content site ID | |
| stagingSiteId | Yes | Staging site ID |
Implementation Reference
- src/index.ts:1095-1118 (handler)The handler function that executes the tool logic by making an API GET request to retrieve the staging site details and returns the JSON response or error.async ({ contentSiteId, stagingSiteId }) => { try { const response: AxiosResponse<ApiResponse<StagingSite>> = await apiClient.get(`/tools/content-sites/${contentSiteId}/staging-sites/${stagingSiteId}`); 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:1088-1095 (schema)The tool metadata including title, description, and Zod input schema for validating contentSiteId and stagingSiteId parameters.title: "Get Staging Site", description: "Get staging site details by ID", inputSchema: { contentSiteId: z.string().describe("Content site ID"), stagingSiteId: z.string().describe("Staging site ID"), }, }, async ({ contentSiteId, stagingSiteId }) => {
- src/index.ts:1084-1119 (registration)The complete registration of the 'get_staging_site' tool using McpServer.registerTool, including name, schema, and handler.// Get Staging Site server.registerTool( "get_staging_site", { title: "Get Staging Site", description: "Get staging site details by ID", inputSchema: { contentSiteId: z.string().describe("Content site ID"), stagingSiteId: z.string().describe("Staging site ID"), }, }, async ({ contentSiteId, stagingSiteId }) => { try { const response: AxiosResponse<ApiResponse<StagingSite>> = await apiClient.get(`/tools/content-sites/${contentSiteId}/staging-sites/${stagingSiteId}`); 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:97-105 (schema)TypeScript interface defining the structure of a StagingSite object, used in the tool's API response type ApiResponse<StagingSite>.interface StagingSite { id: string; contentSiteId: string; name: string; description?: string; status: string; createdAt: string; updatedAt: string; }
- src/index.ts:158-166 (helper)Helper function used by the tool handler to format and return API error messages in a consistent way.function handleApiError(error: any): string { if (error.response) { return `API Error ${error.response.status}: ${error.response.data?.message || error.response.statusText}`; } else if (error.request) { return "Network Error: Unable to reach API server"; } else { return `Error: ${error.message}`; } }