Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

list_flow_runs

Retrieve flow runs from Prefect API with optional filtering by flow ID, limit, and offset parameters.

Instructions

Get a list of flow runs from the Prefect API.

Args:
    limit: Maximum number of flow runs to return (default 20).
    offset: Number of flow runs to skip (default 0).
    flow_id: Optional ID of the flow to filter runs by.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
flow_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'list_flow_runs' MCP tool, registered via @mcp.tool() decorator. It lists flow runs from Prefect API, optionally filtered by flow_id, with pagination support.
    @mcp.tool()
    async def list_flow_runs(
        ctx: Context, limit: int = 20, offset: int = 0, flow_id: Optional[str] = None
    ) -> Dict[str, Any]:
        """Get a list of flow runs from the Prefect API.
    
        Args:
            limit: Maximum number of flow runs to return (default 20).
            offset: Number of flow runs to skip (default 0).
            flow_id: Optional ID of the flow to filter runs by.
        """
        filter_dict = {}
    
        if flow_id:
            filter_dict["flow_id"] = {"equals": flow_id}
    
        async with get_client() as client:
            flow_run_filter = FlowRunFilter(**filter_dict) if filter_dict else None
            flow_runs = await client.read_flow_runs(
                flow_run_filter=flow_run_filter, limit=limit, offset=offset
            )
            return {
                "flow_runs": [run.model_dump() for run in flow_runs],
                "count": len(flow_runs),
            }
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 mentions the API source ('Prefect API') but lacks details on permissions, rate limits, pagination behavior, or response format. The parameter descriptions add some context but don't cover broader operational traits.

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 well-structured and front-loaded with the core purpose, followed by parameter details. It avoids unnecessary fluff, though the parameter explanations could be slightly more integrated into the main text rather than listed separately.

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's moderate complexity (3 parameters, no annotations, but with an output schema), the description is partially complete. It covers parameters well but lacks behavioral context and usage guidelines. The presence of an output schema mitigates the need to explain return values, but overall completeness is adequate with clear gaps.

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

Parameters5/5

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

The description adds significant value beyond the input schema, which has 0% description coverage. It explains all three parameters ('limit', 'offset', 'flow_id') with clear semantics, including defaults and optionality, effectively compensating for the schema's lack of descriptions.

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: 'Get a list of flow runs from the Prefect API.' It specifies the verb ('Get') and resource ('flow runs'), though it doesn't explicitly differentiate from siblings like 'filter_flow_runs' or 'search_flow_runs_by_state' beyond the basic action.

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 only lists parameters without context on optimal use cases or exclusions, leaving the agent to infer usage from tool names alone.

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