get_published_sites
Retrieve published sites for a content site using its ID to access live website information and manage content operations.
Instructions
Get published sites for a content site
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contentSiteId | Yes | Content site ID |
Implementation Reference
- src/index.ts:1233-1268 (registration)Registration of the 'get_published_sites' tool using server.registerTool, including schema and handler function.server.registerTool( "get_published_sites", { title: "Get Published Sites", description: "Get published sites for a content site", inputSchema: { contentSiteId: z.string().describe("Content site ID"), }, }, async ({ contentSiteId }) => { try { const params = new URLSearchParams(); const response: AxiosResponse<ApiResponse<any[]>> = await apiClient.get(`/tools/content-sites/${contentSiteId}/published-sites`); 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:1242-1267 (handler)Handler function for 'get_published_sites' tool. Makes a GET request to the Headlesshost API endpoint `/tools/content-sites/${contentSiteId}/published-sites` and returns the JSON response or error.async ({ contentSiteId }) => { try { const params = new URLSearchParams(); const response: AxiosResponse<ApiResponse<any[]>> = await apiClient.get(`/tools/content-sites/${contentSiteId}/published-sites`); 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:1235-1241 (schema)Input schema for 'get_published_sites' tool, requiring a contentSiteId string.{ title: "Get Published Sites", description: "Get published sites for a content site", inputSchema: { contentSiteId: z.string().describe("Content site ID"), }, },