Skip to main content
Glama
fortunto2

Prefect MCP Server

by fortunto2

get_flow_by_name

Retrieve a specific workflow by its name from the Prefect automation platform to access configuration details and execution parameters.

Instructions

Get a flow by its name.

Args:
    name: Name of the flow to retrieve.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_flow_by_name' MCP tool. It is decorated with @mcp.tool(), which also serves as its registration. Retrieves a Prefect flow by name using the Prefect API client, returning the first matching flow or an error.
    @mcp.tool()
    async def get_flow_by_name(ctx: Context, name: str) -> Dict[str, Any]:
        """Get a flow by its name.
    
        Args:
            name: Name of the flow to retrieve.
        """
        if not name:
            return {"error": "Missing required argument: name"}
    
        async with get_client() as client:
            try:
                # Use correct flow_filter parameter
                flow_filter = FlowFilter(name=FlowFilterName(any_=[name]))
                flows = await client.read_flows(flow_filter=flow_filter)
    
                if not flows:
                    return {"error": f"No flow found with name: {name}"}
    
                # Return the first matching flow
                return {"flow": flows[0].model_dump()}
            except Exception as e:
                return {"error": f"Failed to get flow: {str(e)}"}
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. While 'Get' implies a read operation, the description doesn't specify whether this requires authentication, what happens if the flow doesn't exist (error vs. null return), whether it's case-sensitive, or any rate limits. It provides minimal behavioral context beyond the basic operation.

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 appropriately concise with two sentences: a clear purpose statement and a parameter explanation. The structure is front-loaded with the main purpose first. The 'Args:' section is slightly redundant but adds minimal clutter.

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 low complexity (single parameter read operation) and the presence of an output schema (which handles return values), the description is minimally complete. However, with no annotations and multiple sibling tools, it lacks context about authentication needs, error handling, and differentiation from alternatives, leaving gaps for an AI agent.

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 the parameter 'name' with the explanation 'Name of the flow to retrieve,' which provides basic semantics. However, with 0% schema description coverage and only one parameter, this is the minimum viable information. It doesn't specify format requirements (e.g., string constraints) or provide examples, leaving the schema to handle details.

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 verb 'Get' and resource 'flow by its name', making the purpose immediately understandable. It distinguishes this tool from sibling tools like 'get_flow_by_id' by specifying the lookup method. However, it doesn't explicitly differentiate from other flow retrieval tools like 'filter_flows' or 'list_flows' beyond the name parameter.

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. With siblings like 'get_flow_by_id', 'filter_flows', and 'list_flows' available, there's no indication whether this is the preferred method for name-based retrieval, whether it requires exact name matching, or what happens if multiple flows share the same name.

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