Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

create_flow_run

Start a workflow execution by creating a new flow run for a specified deployment, with optional parameters to customize the run.

Instructions

Create a new flow run for the specified deployment (Legacy).

Args:
    deployment_id: ID of the deployment to create a run for.
    parameters: Dictionary with parameters for the flow run (optional).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deployment_idYes
parametersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary handler for the "create_flow_run" MCP tool (legacy). Delegates to the core implementation function.
    @mcp.tool()
    async def create_flow_run(
        ctx: Context, deployment_id: str, parameters: Optional[Dict[str, Any]] = None
    ) -> Dict[str, Any]:
        """Create a new flow run for the specified deployment (Legacy).
    
        Args:
            deployment_id: ID of the deployment to create a run for.
            parameters: Dictionary with parameters for the flow run (optional).
        """
        return await create_flow_run_from_deployment(ctx, deployment_id, parameters)
  • Core implementation of flow run creation, registered as a separate tool "create_flow_run_from_deployment". Called by the legacy "create_flow_run" tool.
    @mcp.tool()
    async def create_flow_run_from_deployment(
        ctx: Context,
        deployment_id: str,
        parameters: Optional[Dict[str, Any]] = None,
        name: Optional[str] = None,
        timeout: int = 0,
    ) -> Dict[str, Any]:
        """Create a new flow run for the specified deployment.
    
        Args:
            deployment_id: ID of the deployment or name in format 'flow_name/deployment_name'.
            parameters: Dictionary with parameters for the flow run (optional).
            name: Optional name for the flow run.
            timeout: Timeout in seconds, 0 means no waiting for completion (default 0).
        """
        if not deployment_id:
            return {"error": "Missing required argument: deployment_id"}
    
        from prefect.deployments import run_deployment
    
        try:
            # Создаем flow run с помощью функции run_deployment
            result = await run_deployment(
                name=deployment_id,  # В документации это "name", а не "deployment_id"
                parameters=parameters or {},
                timeout=timeout,
                flow_run_name=name,
            )
    
            return {"flow_run_id": str(result)}
        except Exception as e:
            return {"error": f"Failed to create flow run: {str(e)}"}
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states this creates something (implying a write/mutation operation) but doesn't disclose permissions needed, rate limits, whether the operation is idempotent, what happens on failure, or what the created flow run will do. The 'Legacy' note hints at deprecated functionality but lacks detail.

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

Conciseness4/5

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

The description is efficiently structured with a clear purpose statement followed by parameter explanations. Every sentence serves a purpose, though the 'Legacy' parenthetical could be better integrated. The two-sentence format is appropriately concise for this tool.

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

Completeness3/5

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

Given this is a creation tool with no annotations but with an output schema (which handles return values), the description is moderately complete. It covers the basic purpose and parameters but lacks important context about when to use it versus alternatives, behavioral constraints, and the implications of 'Legacy' status.

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?

With 0% schema description coverage, the description compensates well by explaining both parameters: 'deployment_id' as 'ID of the deployment to create a run for' and 'parameters' as 'Dictionary with parameters for the flow run (optional).' This adds meaningful context beyond the bare schema, though it doesn't specify parameter format constraints or examples.

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 ('Create a new flow run') and target resource ('for the specified deployment'), which is specific and actionable. However, it doesn't distinguish itself from the sibling tool 'create_flow_run_from_deployment' - both appear to create flow runs, so the differentiation is unclear.

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 minimal guidance - only noting this is for 'Legacy' deployments. It doesn't explain when to use this tool versus 'create_flow_run_from_deployment' or other flow run creation alternatives, nor does it mention prerequisites or constraints beyond the legacy context.

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/fortunto2/prefect-mcp-server'

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