Skip to main content
Glama

get_task_run

Retrieve detailed information about a specific Prefect task run using its unique identifier to monitor execution status and access run metadata.

Instructions

Get details of a specific task run by ID.

Args: task_run_id: The task run UUID

Returns: Task run details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_run_idYes

Implementation Reference

  • The handler function for the 'get_task_run' MCP tool. It retrieves details of a specific task run by its ID using the Prefect client, adds a UI URL, and returns the information as text content.
    @mcp.tool async def get_task_run( task_run_id: str, ) -> List[Union[types.TextContent, types.ImageContent, types.EmbeddedResource]]: """ Get details of a specific task run by ID. Args: task_run_id: The task run UUID Returns: Task run details """ async with get_client() as client: task_run = await client.read_task_run(UUID(task_run_id)) # Add UI link task_run_dict = task_run.model_dump() task_run_dict["ui_url"] = get_task_run_url(task_run_id) return [types.TextContent(type="text", text=str(task_run_dict))]
  • Helper function to generate the UI URL for a task run, used within the get_task_run handler and others.
    def get_task_run_url(task_run_id: str) -> str: base_url = PREFECT_API_URL.replace("/api", "") return f"{base_url}/task-runs/{task_run_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