Skip to main content
Glama
fortunto2
by fortunto2

get_flow_by_id

Retrieve a specific workflow by its unique ID using the Prefect MCP Server, enabling efficient management and tracking of automated workflows.

Instructions

Get a flow by its ID.

Args: flow_id: ID of the flow to retrieve.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_idYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the 'get_flow_by_id' tool. It retrieves a Prefect flow by its ID using the Prefect client, handles errors, and returns the flow data or an error message.
    @mcp.tool() async def get_flow_by_id(ctx: Context, flow_id: str) -> Dict[str, Any]: """Get a flow by its ID. Args: flow_id: ID of the flow to retrieve. """ if not flow_id: return {"error": "Missing required argument: flow_id"} async with get_client() as client: try: flow = await client.read_flow(UUID(flow_id)) return {"flow": flow.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