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
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes |
Implementation Reference
- src/tools/scripts.ts:132-146 (handler)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; } }
- src/tools/scripts.ts:125-131 (schema)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(), }), },
- src/tools/scripts.ts:123-147 (registration)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; } } );