Skip to main content
Glama

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

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