Skip to main content
Glama

create_flow_run_from_deployment

Execute a Prefect workflow by triggering a flow run from an existing deployment, with optional parameters, tags, and idempotency controls.

Instructions

Create a flow run from a deployment.

Args: deployment_id: The deployment UUID parameters: Optional parameters to pass to the flow run name: Optional name for the flow run tags: Optional tags for the flow run idempotency_key: Optional idempotency key

Returns: Details of the created flow run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
idempotency_keyNo
nameNo
parametersNo
tagsNo

Implementation Reference

  • The handler function for the 'create_flow_run_from_deployment' tool, decorated with @mcp.tool for registration. It uses the Prefect client to create a flow run from the specified deployment, adds a UI URL, and returns the flow run details as text content.
    @mcp.tool
    async def create_flow_run_from_deployment(
        deployment_id: str,
        parameters: Optional[Dict[str, Any]] = None,
        name: Optional[str] = None,
        tags: Optional[List[str]] = None,
        idempotency_key: Optional[str] = None,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Create a flow run from a deployment.
        
        Args:
            deployment_id: The deployment UUID
            parameters: Optional parameters to pass to the flow run
            name: Optional name for the flow run
            tags: Optional tags for the flow run
            idempotency_key: Optional idempotency key
            
        Returns:
            Details of the created flow run
        """
        async with get_client() as client:
            parameters = parameters or {}
            
            flow_run = await client.create_flow_run_from_deployment(
                deployment_id=UUID(deployment_id),
                parameters=parameters,
                name=name,
                tags=tags,
                idempotency_key=idempotency_key,
            )
            
            # Add URL
            flow_run_dict = flow_run.model_dump()
            flow_run_dict["ui_url"] = PREFECT_API_URL.replace("/api", "") + f"/flow-runs/{flow_run.id}"
            
            return [types.TextContent(type="text", text=str(flow_run_dict))]
  • The @mcp.tool decorator registers the create_flow_run_from_deployment function as an MCP tool.
    @mcp.tool
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates a flow run, implying a write operation, but doesn't cover critical aspects like permissions required, whether it's idempotent (despite the parameter), error conditions, or what 'Details of the created flow run' entails. This is inadequate for a mutation tool with zero annotation coverage.

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

Conciseness3/5

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

The description is structured with clear sections (Args, Returns) and is relatively concise. However, the first sentence is redundant with the tool name, and the parameter explanations are minimal without adding much value beyond naming. It could be more front-loaded with critical usage information.

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 complexity (a write operation with 5 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain the return value format, error handling, or behavioral nuances like idempotency. For a tool that creates resources, this leaves significant gaps for an AI agent to operate effectively.

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?

Schema description coverage is 0%, but the description compensates well by listing all 5 parameters with brief explanations (e.g., 'Optional parameters to pass to the flow run'). It clarifies that 'deployment_id' is a UUID and others are optional, adding meaningful context beyond the bare schema. However, it doesn't explain parameter formats or constraints (e.g., what 'parameters' should contain), preventing a perfect score.

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 tool's purpose: 'Create a flow run from a deployment.' This is a specific verb ('create') + resource ('flow run') + source ('from a deployment'), which is clear and actionable. However, it doesn't explicitly differentiate from siblings like 'restart_flow_run' or 'set_flow_run_state,' which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing deployment), exclusions, or comparisons to sibling tools like 'restart_flow_run' or 'set_flow_run_state.' This leaves the agent without context for tool selection.

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