Skip to main content
Glama

get_flow

Retrieve detailed information about a specific workflow by providing its unique identifier, enabling users to inspect flow configurations and status.

Instructions

Get details of a specific flow by ID.

Args: flow_id: The flow UUID

Returns: Flow details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flow_idYes

Implementation Reference

  • The handler function for the 'get_flow' tool. It retrieves details of a specific flow by its ID using the Prefect client, adds a UI URL, and returns the information as text content.
    @mcp.tool async def get_flow( flow_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Get details of a specific flow by ID. Args: flow_id: The flow UUID Returns: Flow details """ try: async with get_client() as client: # Validate flow_id try: flow_uuid = UUID(flow_id) except ValueError: return [types.TextContent( type="text", text=f"Invalid flow ID format: {flow_id}. Must be a valid UUID." )] flow = await client.read_flow(flow_uuid) # Add UI link flow_dict = flow.model_dump() flow_dict["ui_url"] = get_flow_url(flow_id) return [types.TextContent(type="text", text=str(flow_dict))] except Exception as e: error_message = f"Error fetching flow {flow_id}: {str(e)}" return [types.TextContent(type="text", text=error_message)]
  • The import statement in main.py that loads the flow module, thereby registering the 'get_flow' tool via its @mcp.tool decorator.
    if APIType.FLOW.value in apis: info("Loading Flow API...") from . import flow
  • Helper function used by 'get_flow' to generate a UI URL for the flow.
    def get_flow_url(flow_id: str) -> str: """Generate a UI URL for a flow.""" base_url = PREFECT_API_URL.replace("/api", "") return f"{base_url}/flows/{flow_id}"

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/allen-munsch/mcp-prefect'

If you have feedback or need assistance with the MCP directory API, please join our Discord server