Skip to main content
Glama
martin-1103
by martin-1103

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

TableJSON Schema
NameRequiredDescriptionDefault
flowIdYesID of the flow to delete

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)
              }
            ]
          };
      }
    }
  • 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
    };
  • 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);
    }

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/martin-1103/mcp2'

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