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}"
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. It states the tool retrieves details but doesn't describe what 'details' include (e.g., status, timestamps, outputs), whether it's a read-only operation, error handling for invalid IDs, or any rate limits. For a retrieval tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 sized and front-loaded, with the core purpose stated first in a clear sentence. The 'Args' and 'Returns' sections add structure without redundancy. However, the 'Returns' line is vague ('Task run details'), slightly reducing efficiency, but overall it's concise with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It doesn't explain the return value format, error conditions, or how it differs from sibling tools like 'get_task_runs'. For a retrieval tool in a context with many similar tools, more contextual guidance is needed to ensure proper agent usage.

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 minimal meaning beyond the input schema. It specifies that 'task_run_id' is a UUID, which clarifies the parameter type beyond the schema's 'string' type, but schema description coverage is 0%, and the description doesn't explain format constraints or provide examples. With one parameter and low schema coverage, it partially compensates but remains basic.

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 tool's purpose: 'Get details of a specific task run by ID.' It specifies the verb ('Get details') and resource ('task run'), and distinguishes it from sibling tools like 'get_task_runs' (plural) which likely lists multiple task runs. However, it doesn't explicitly contrast with 'get_task_runs_by_flow_run' or other getters, keeping it from a perfect score.

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. It doesn't mention sibling tools like 'get_task_runs' (for listing) or 'get_task_runs_by_flow_run' (for filtering), nor does it specify prerequisites such as needing a valid task run ID. Usage is implied by the name and description alone.

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

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