Skip to main content
Glama
fortunto2
by fortunto2

get_flow_by_name

Retrieve a specific workflow by its name from the Prefect MCP Server, enabling efficient management and execution of automated tasks through the Model Context Protocol.

Instructions

Get a flow by its name.

Args: name: Name of the flow to retrieve.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The handler function for the 'get_flow_by_name' tool. It retrieves a Prefect flow by name using the Prefect client, filters flows matching the name, returns the first one or an error. Registered with the @mcp.tool() decorator.
    @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)}"}

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