delete_workflow
Delete a workflow in Storyblok by its ID using the Management API. The default workflow is protected and cannot be removed.
Instructions
Deletes a workflow by its ID in a Storyblok space via the Management API. The default workflow cannot be deleted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_id | Yes | ID of the workflow to delete |
Implementation Reference
- src/tools/workflows.ts:140-162 (handler)Handler function that deletes a workflow by ID via the Storyblok Management API. Uses apiDelete internally and returns a success message string (not JSON).
// Tool: delete_workflow server.tool( 'delete_workflow', 'Deletes a workflow by its ID in a Storyblok space via the Management API. The default workflow cannot be deleted.', { workflow_id: z.number().describe('ID of the workflow to delete'), }, async ({ workflow_id }) => { try { await apiDelete(`/workflows/${workflow_id}`); return { content: [ { type: 'text' as const, text: `Workflow ${workflow_id} has been successfully deleted.` }, ], }; } catch (error) { if (error instanceof APIError) { return createErrorResponse(error); } throw error; } } ); - src/tools/workflows.ts:144-146 (schema)Input schema requiring workflow_id as a number.
{ workflow_id: z.number().describe('ID of the workflow to delete'), }, - src/tools/workflows.ts:10-10 (registration)Registration function that registers all workflow tools, including delete_workflow, with the MCP server.
export function registerWorkflows(server: McpServer): void { - src/tools/index.ts:59-59 (registration)Top-level registration call that triggers registration of all workflow tools including delete_workflow.
registerWorkflows(server); - src/utils/api.ts:227-234 (helper)Helper function that performs the HTTP DELETE request to the Storyblok Management API.
export async function apiDelete<T = unknown>(path: string): Promise<T> { const url = buildManagementUrl(path); const response = await fetch(url, { method: 'DELETE', headers: getManagementHeaders(), }); return handleResponse<T>(response, url); }