delete_flow
Remove API workflow configurations by specifying the flow ID to manage your backend development environment and testing processes.
Instructions
Delete a flow
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flowId | Yes | ID of the flow to delete |
Input Schema (JSON Schema)
{
"properties": {
"flowId": {
"description": "ID of the flow to delete",
"type": "string"
}
},
"required": [
"flowId"
],
"type": "object"
}
Implementation Reference
- The primary handler function that implements the delete_flow tool logic. Validates input, calls the backend API to delete the flow, and formats the MCP response.export async function handleDeleteFlow(args: any): Promise<McpToolResponse> { try { const { flowId } = args; if (!flowId) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: 'Flow ID is required' }, null, 2) } ] }; } const instances = await getInstances(); const deleteResponse = await instances.backendClient.deleteFlow(flowId); if (!deleteResponse.success) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: deleteResponse.message || 'Failed to delete flow' }, null, 2) } ] }; } return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Flow deleted successfully' }, null, 2) } ] }; } catch (error: any) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: error.message || 'Unknown error occurred while deleting flow' }, null, 2) } ] }; } }
- src/tools/flows/tools.ts:234-248 (schema)Tool schema definition for delete_flow, specifying input validation (requires flowId) and linking to the handler.export const deleteFlowTool: McpTool = { name: 'delete_flow', description: 'Delete a flow', inputSchema: { type: 'object', properties: { flowId: { type: 'string', description: 'ID of the flow to delete' } }, required: ['flowId'] }, handler: handleDeleteFlow };
- src/tools/index.ts:184-187 (registration)Registration of the delete_flow tool handler in the main index.ts, dynamically importing and delegating to the specific handler function.'delete_flow': async (args: any) => { const { handleDeleteFlow } = await import('./flows/handlers/detailsHandler.js'); return handleDeleteFlow(args); }