Skip to main content
Glama
GJakobi

Hatchet MCP Server

by GJakobi

list_runs

Retrieve workflow execution records with filters for name, status, time range, and result count to monitor and debug processes.

Instructions

List workflow runs with optional filters.

Args: workflow_name: Filter by workflow name (e.g., 'qa-workflow', 'embed-workflow') status: Filter by status ('queued', 'running', 'completed', 'failed', 'cancelled') since_hours: How many hours back to search (default: 24) limit: Maximum number of runs to return (default: 50)

Returns a list of runs with their status, metadata, and timing info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_nameNo
statusNo
since_hoursNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `list_runs` tool handler implementation. It uses the Hatchet SDK to query workflow runs and applies filtering logic for workflow name, status, time range, and result count limits.
    @mcp.tool()
    async def list_runs(
        workflow_name: str | None = None,
        status: str | None = None,
        since_hours: int = 24,
        limit: int = 50,
    ) -> list[dict]:
        """
        List workflow runs with optional filters.
    
        Args:
            workflow_name: Filter by workflow name (e.g., 'qa-workflow', 'embed-workflow')
            status: Filter by status ('queued', 'running', 'completed', 'failed', 'cancelled')
            since_hours: How many hours back to search (default: 24)
            limit: Maximum number of runs to return (default: 50)
    
        Returns a list of runs with their status, metadata, and timing info.
        """
        try:
            hatchet = get_hatchet_client()
            # Build filter parameters
            params: dict[str, Any] = {
                "since": datetime.now(tz=timezone.utc) - timedelta(hours=since_hours),
                "limit": limit,
            }
    
            if status and status.lower() in STATUS_MAP:
                params["statuses"] = [STATUS_MAP[status.lower()]]
    
            if workflow_name:
                # Need to get workflow ID from name
                workflows = await hatchet.workflows.aio_list()
                workflow_ids = [
                    w.metadata.id for w in (workflows.rows or [])
                    if hasattr(w, "name") and w.name == workflow_name
                ]
                if workflow_ids:
                    params["workflow_ids"] = workflow_ids
    
            runs = await hatchet.runs.aio_list(**params)
            return [_serialize_run(r) for r in (runs.rows or [])]
        except Exception as e:
            return [{"error": str(e)}]
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It successfully documents default values (24 hours, 50 limit) and return structure ('status, metadata, and timing info'), but omits critical behavioral details like result ordering (chronological?), pagination mechanics beyond the limit parameter, and whether archived/completed runs are included indefinitely or time-boxed.

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 docstring-style format with explicit 'Args' and 'Returns' sections is clear and pragmatic given the schema deficiencies. While the Args block is lengthy, every line is necessary to compensate for the undocumented schema. No tautology or repetition of the tool name.

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

Completeness4/5

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

Given the existence of an output schema (which handles return value details) and the comprehensive Args documentation, the description is largely complete for a filtering tool. The only notable gaps are the lack of sibling differentiation and absence of result ordering guarantees or time-window behavior explanations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Excellent compensation for 0% schema description coverage. The Args section provides detailed semantics for all 4 parameters: workflow_name includes realistic examples ('qa-workflow'), status enumerates valid values not present in the schema enum, and since_hours/limit explain units and defaults. This adds substantial meaning beyond the bare schema titles.

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 verb ('List') and resource ('workflow runs') with scope ('with optional filters'). However, it fails to distinguish from the sibling tool 'search_runs', leaving ambiguity about which to use for filtering vs searching.

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?

No guidance is provided on when to use this tool versus siblings like 'search_runs' or 'get_run_status'. The description does not specify prerequisites, expected query patterns, or when 'list_runs' is insufficient and 'search_runs' should be preferred instead.

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/GJakobi/hatchet-mcp'

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