Skip to main content
Glama
PrefectHQ

prefect-mcp-server

Official
by PrefectHQ

get_task_runs

Retrieve task runs with optional filters by state, name, or other criteria. Use to monitor workflow execution, find failed tasks, or search for tasks by name pattern.

Instructions

Get task runs with optional filters.

Returns a list of task runs and their details matching the filters. Note that 'task_inputs' contains dependency tracking information (upstream task relationships), not the actual parameter values passed to the task.

Filter operators:

  • any_: Match any value in list

  • like_: SQL LIKE pattern matching

  • not_any_: Exclude values

  • is_null_: Check for null/not null

Examples: - List recent tasks: get_task_runs() - Get specific task: get_task_runs(filter={"id": {"any_": [""]}}) - Failed tasks: get_task_runs(filter={"state": {"type": {"any_": ["FAILED"]}}}) - Tasks by pattern: get_task_runs(filter={"name": {"like_": "%process%"}})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of task runs to return
filterNoJSON filter object for advanced querying. Supports all Prefect TaskRunFilter fields.
workspace_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYes
errorYes
successYes
task_runsYes
Behavior4/5

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

With no annotations, the description carries full burden. It warns that 'task_inputs' contains dependency tracking, not parameter values, and explains filter operators. It does not discuss rate limits or authentication, but the read-only nature is implied.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose, includes a concise warning, lists filter operators, and provides examples. Every sentence adds value without unnecessary verbosity.

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?

The description explains purpose, filters, and a key nuance. Output schema exists, so return values need not be elaborated. It lacks mention of pagination or limit behavior, but these are in the schema. Overall sufficient for the complexity.

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?

The description adds meaning beyond the schema by providing filter operator details, examples, and a warning about 'task_inputs'. Schema coverage is 67%, so the description compensates effectively with usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'task runs', and distinguishes from sibling tools like get_flow_runs by specifying it returns task run details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes filter operators and examples, but does not explicitly guide when to use this tool over siblings (e.g., get_flow_runs). It lacks exclusions or comparison to alternatives.

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/PrefectHQ/prefect-mcp-server'

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