Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

get_flow_run_by_id

Retrieve a specific workflow execution's details by providing its unique identifier to monitor status and access results.

Instructions

Get a flow run by its ID.

Args:
    flow_run_id: ID of the flow run to retrieve.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_run_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the 'get_flow_run_by_id' tool logic. It fetches the flow run using the Prefect client, validates input, and handles errors.
    @mcp.tool()
    async def get_flow_run_by_id(ctx: Context, flow_run_id: str) -> Dict[str, Any]:
        """Get a flow run by its ID.
    
        Args:
            flow_run_id: ID of the flow run to retrieve.
        """
        if not flow_run_id:
            return {"error": "Missing required argument: flow_run_id"}
    
        async with get_client() as client:
            try:
                flow_run = await client.read_flow_run(UUID(flow_run_id))
                return {"flow_run": flow_run.model_dump()}
            except Exception as e:
                return {"error": f"Failed to get 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 the full burden of behavioral disclosure. It states this is a retrieval operation ('Get'), implying it's likely read-only, but doesn't confirm safety aspects like whether it requires authentication, has rate limits, or what happens with invalid IDs. The description adds minimal behavioral context beyond the basic action.

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 perfectly concise with zero wasted words. The purpose is stated in a clear first sentence, followed by a brief parameter explanation. Every sentence earns its place, and the structure is appropriately front-loaded with the core functionality.

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 the tool has an output schema (which handles return values) and only one parameter, the description is reasonably complete for a simple retrieval operation. However, with no annotations and multiple sibling tools offering similar functionality, more context about when to choose this specific tool would improve completeness.

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 schema description coverage is 0%, but the description compensates by explaining the single parameter ('flow_run_id: ID of the flow run to retrieve'). This adds meaningful semantics beyond the bare schema, though it doesn't specify format constraints or provide examples. For a single parameter tool, this meets the baseline expectation.

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 with a specific verb ('Get') and resource ('a flow run by its ID'), making it immediately understandable. However, it doesn't explicitly distinguish this tool from its sibling 'get_flow_by_id' or 'filter_flow_runs', which could retrieve similar data through different mechanisms.

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 like 'filter_flow_runs' or 'search_flow_runs_by_state'. It doesn't mention prerequisites, error conditions, or typical use cases, leaving the agent with minimal contextual direction.

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