Skip to main content
Glama

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
NameRequiredDescriptionDefault
contentSiteIdYesContent site ID
stagingSiteIdYesStaging site ID

Implementation Reference

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

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