Skip to main content
Glama

delete_flow

Remove a workflow from Prefect by specifying its unique identifier to declutter your automation environment and manage flow lifecycle.

Instructions

Delete a flow by ID.

Args: flow_id: The flow UUID

Returns: Confirmation message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_idYes

Implementation Reference

  • The @mcp.tool decorated handler function for the 'delete_flow' tool. It validates the flow_id as UUID, deletes the flow using Prefect client, and returns success or error message.
    @mcp.tool
    async def delete_flow(
        flow_id: str,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Delete a flow by ID.
        
        Args:
            flow_id: The flow UUID
            
        Returns:
            Confirmation message
        """
        try:
            async with get_client() as client:
                # Validate flow_id
                try:
                    flow_uuid = UUID(flow_id)
                except ValueError:
                    return [types.TextContent(
                        type="text", 
                        text=f"Invalid flow ID format: {flow_id}. Must be a valid UUID."
                    )]
                
                await client.delete_flow(flow_uuid)
                
                return [types.TextContent(type="text", text=f"Flow '{flow_id}' deleted successfully.")]
        
        except Exception as e:
            error_message = f"Error deleting flow {flow_id}: {str(e)}"
            return [types.TextContent(type="text", text=error_message)]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool deletes a flow and returns a confirmation message, but lacks critical behavioral details: whether deletion is permanent/reversible, required permissions, side effects (e.g., cascading deletion of related runs), error conditions, or rate limits. For a destructive operation with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose ('Delete a flow by ID'), followed by brief, structured sections for Args and Returns. Every sentence earns its place with no redundant information, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature, lack of annotations, no output schema, and incomplete behavioral disclosure, the description is insufficient. It doesn't address safety concerns, error handling, or output details beyond a vague 'confirmation message,' leaving gaps that could hinder correct agent invocation in a production context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter: it specifies that flow_id is a 'UUID' (clarifying format beyond the schema's generic 'string' type) and ties it to identifying the flow to delete. With 0% schema description coverage and only one parameter, this adequately compensates, though it doesn't detail UUID format examples or validation rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and target resource ('a flow by ID'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from sibling deletion tools like delete_flow_run or delete_deployment, which operate on different resources but share the same 'delete' verb pattern.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. While the description specifies 'by ID,' it doesn't mention prerequisites (e.g., needing a flow ID from get_flows), exclusions (e.g., cannot delete active flows), or comparisons with similar tools like delete_flow_run for run-level deletions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/allen-munsch/mcp-prefect'

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