Skip to main content
Glama

restart_flow_run

Restart a Prefect workflow execution by providing the flow run ID to initiate a new run from the same starting point.

Instructions

Restart a flow run.

Args: flow_run_id: The flow run UUID

Returns: Details of the new flow run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_run_idYes

Implementation Reference

  • The restart_flow_run tool handler, decorated with @mcp.tool. It restarts the specified Prefect flow run by creating a new one from the original using the Prefect client, adds a UI URL, and returns the details as text content.
    @mcp.tool
    async def restart_flow_run(
        flow_run_id: str,
    ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]:
        """
        Restart a flow run.
        
        Args:
            flow_run_id: The flow run UUID
            
        Returns:
            Details of the new flow run
        """
        async with get_client() as client:
            flow_run_id_uuid = UUID(flow_run_id)
            new_flow_run = await client.create_flow_run_from_flow_run(flow_run_id_uuid)
            
            new_flow_run_dict = new_flow_run.dict()
            new_flow_run_dict["ui_url"] = get_flow_run_url(str(new_flow_run.id))
            
            return [types.TextContent(type="text", text=str(new_flow_run_dict))]
  • The @mcp.tool decorator that registers the restart_flow_run 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 restarts a flow run, implying a mutation operation, but doesn't describe what 'restart' entails (e.g., does it create a new run, reset state, or resume execution?), potential side effects, authentication needs, or rate limits. 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.

Conciseness4/5

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

The description is concise and well-structured: a brief purpose statement followed by separate 'Args' and 'Returns' sections. Every sentence earns its place, with no redundant information. However, it could be more front-loaded by integrating the parameter details into the main description for faster scanning.

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 mutation tool restarting flow runs), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain the restart behavior, return value details beyond 'Details of the new flow run', error conditions, or how it fits with siblings. This leaves significant gaps for an agent to use the tool effectively.

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

Parameters3/5

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

The description adds minimal semantics: it names the parameter ('flow_run_id') and specifies it's a 'UUID', which clarifies the format beyond the schema's generic 'string' type. However, with 0% schema description coverage and only 1 parameter, this provides basic but incomplete context—it doesn't explain where to find the UUID or validation rules. The baseline is 4 for 0 parameters, but here there's 1 parameter with some added value, warranting a 3.

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 ('Restart') and resource ('a flow run'), which is specific and unambiguous. It distinguishes from obvious siblings like 'cancel_flow_run' by focusing on restarting rather than terminating. However, it doesn't explicitly differentiate from all siblings (e.g., 'set_flow_run_state'), so it's not a perfect 5.

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., the flow run must be in a restartable state), exclusions (e.g., cannot restart a completed flow run), or comparisons to siblings like 'cancel_flow_run' or 'set_flow_run_state'. This leaves the agent with minimal context for decision-making.

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