Skip to main content
Glama

get_sites

Retrieve all Webflow sites accessible to your authenticated account to manage and view your portfolio.

Instructions

Retrieve a list of all Webflow sites accessible to the authenticated user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_sites' tool. It uses WebflowClient to list all sites, formats them with details like ID, name, workspace, dates, and preview URL, and returns formatted text content.
    get_sites: async () => { try { const webflow = new WebflowClient({ accessToken }); const { sites } = await webflow.sites.list(); if (!Array.isArray(sites) || sites.length === 0) { return { content: [ { type: "text" as const, text: "No sites found for this account.", }, ], }; } const formattedSites = sites .map( (site) => ` • Site: ${site.displayName} - ID: ${site.id} - Workspace: ${site.workspaceId} - Created: ${formatDate(site?.createdOn)} - Last Published: ${formatDate(site?.lastPublished)} - Preview URL: ${site.previewUrl || "N/A"} ` ) .join("\n"); return { content: [ { type: "text" as const, text: `Found ${sites.length} sites:\n${formattedSites}`, }, ], }; } catch (error: unknown) { console.error("Error fetching sites:", error); throw new Error("Failed to fetch sites list"); } },
  • src/index.ts:76-85 (registration)
    Tool registration entry in TOOL_DEFINITIONS array, which is returned in response to ListToolsRequest. Includes name, description, and empty input schema.
    { name: "get_sites", description: "Retrieve a list of all Webflow sites accessible to the authenticated user", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Zod schema definition for get_sites tool input validation (accepts no parameters).
    getSites: z.object({}),
  • Utility helper function used by the get_sites handler to format creation and last published dates.
    function formatDate(date: Date | undefined | null): string { if (!date) return "N/A"; return date.toLocaleString(); }

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