Skip to main content
Glama

get_site

Retrieve detailed Webflow site information by ID, including workspace, creation date, display name, and publishing details for site management.

Instructions

Retrieve detailed information about a specific Webflow site by ID, including workspace, creation date, display name, and publishing details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteIdYesThe unique identifier of the Webflow site

Implementation Reference

  • The asynchronous handler function for the 'get_site' tool. It validates input using Zod, fetches the site details from Webflow API, formats the response, and handles specific errors like site not found.
    get_site: async (args: unknown) => {
      const { siteId } = schemas.toolInputs.getSite.parse(args);
    
      try {
        const webflow = new WebflowClient({ accessToken });
        const site = await webflow.sites.get(siteId);
    
        if (!site) {
          throw new Error("Site not found");
        }
    
        const formattedSite = `• Site Details:
              ID: ${site.id}
              Display Name: ${site.displayName}
              Short Name: ${site.shortName}
            
            - Workspace Information:
              Workspace ID: ${site.workspaceId}
            
            - Dates:
              Created On: ${formatDate(site?.createdOn)}
              Last Published: ${formatDate(site?.lastPublished)}
            
            - URLs:
              Preview URL: ${site.previewUrl || "N/A"}`;
    
        return {
          content: [
            {
              type: "text" as const,
              text: formattedSite,
            },
          ],
        };
      } catch (error: unknown) {
        if (isWebflowApiError(error) && error.code === "NOT_FOUND") {
          return {
            content: [
              {
                type: "text" as const,
                text: `Site with ID ${siteId} not found.`,
              },
            ],
          };
        }
        console.error("Error fetching site:", error);
        throw new Error("Failed to fetch site details");
      }
    },
  • src/index.ts:61-75 (registration)
    The tool registration/definition for 'get_site' in the TOOL_DEFINITIONS array, which is returned by the listTools handler. Includes name, description, and JSON input schema.
    {
      name: "get_site",
      description:
        "Retrieve detailed information about a specific Webflow site by ID, including workspace, creation date, display name, and publishing details",
      inputSchema: {
        type: "object",
        properties: {
          siteId: {
            type: "string",
            description: "The unique identifier of the Webflow site",
          },
        },
        required: ["siteId"],
      },
    },
  • Zod schema used for input validation inside the get_site handler.
    getSite: z.object({
      siteId: z.string().min(1, "Site ID is required"),
    }),
  • Helper utility function used to format dates in the site details response.
    function formatDate(date: Date | undefined | null): string {
      if (!date) return "N/A";
      return date.toLocaleString();
    }
  • Helper type guard function used to check for Webflow API errors in the handler.
    function isWebflowApiError(error: unknown): error is WebflowApiError {
      return error !== null && typeof error === "object" && "code" in error;
    }
Install Server

Other Tools

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/kapilduraphe/webflow-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server