Skip to main content
Glama
webflow

Webflow

Official
by webflow

delete_all_site_scripts

Remove all custom scripts from a Webflow site to clean up code and resolve script conflicts.

Instructions

Delete all custom scripts from a site.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
site_idYes

Implementation Reference

  • The handler function that executes the tool logic by calling the Webflow API's sites.scripts.deleteCustomCode method to delete all custom scripts from the specified site. Handles 404 errors gracefully.
    async ({ site_id }) => {
      try {
        const response = await getClient().sites.scripts.deleteCustomCode(
          site_id,
          requestOptions
        );
        return formatResponse("Custom Code Deleted");
      } catch (error) {
        // If it's a 404, we'll try to clear the scripts another way
        if (isApiError(error) && error.status === 404) {
          return formatResponse(error.message ?? "No custom code found");
        }
        throw error;
      }
    }
  • Inline input schema definition for the tool using Zod, requiring a 'site_id' string parameter.
    {
      title: "Delete All Site Scripts",
      description: "Delete all custom scripts from a site.",
      inputSchema: z.object({
        site_id: z.string(),
      }),
    },
  • The server.registerTool call that registers the 'delete_all_site_scripts' tool, providing title, description, input schema, and the handler function.
    server.registerTool(
      "delete_all_site_scripts",
      {
        title: "Delete All Site Scripts",
        description: "Delete all custom scripts from a site.",
        inputSchema: z.object({
          site_id: z.string(),
        }),
      },
      async ({ site_id }) => {
        try {
          const response = await getClient().sites.scripts.deleteCustomCode(
            site_id,
            requestOptions
          );
          return formatResponse("Custom Code Deleted");
        } catch (error) {
          // If it's a 404, we'll try to clear the scripts another way
          if (isApiError(error) && error.status === 404) {
            return formatResponse(error.message ?? "No custom code found");
          }
          throw error;
        }
      }
    );

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

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