Work with Prefect from your agent
Inspect runs through MCP, use the CLI from your project, and look up current Prefect documentation.
Get started
Connect your workspace
Choose an agent guide for plugin or MCP setup. Hosted connections use Prefect Cloud sign-in; local MCP servers use your own Prefect configuration.
Choose an agentUse the CLI for project work
A coding agent can use the Prefect CLI in your development environment. Unlike the read-only MCP tools, CLI commands can change your workspace. Review commands that deploy, run, or delete resources.
CLI setup for agentsPrefect skills
The public skills repository is coming soon. Installation instructions will be added here when it is available.
Investigate a run
Paste this into your agent after connecting.
Use Prefect to investigate the most recent failed flow run in my chosen workspace. Read its task runs and logs, cite the run and relevant errors, and explain what I should check before retrying. Do not retry or change anything.
Documentation & source
MCP setup and authenticationPlugins and MCP sourceInstall PrefectInvestigate a failed Prefect run.
Ask your agent to inspect a Prefect flow run. It can read task states and logs to help you understand the failure.
“Why did last night’s
orders sync fail?”
Read full prompt
Use Prefect to investigate the most recent failed flow run in my chosen workspace. Read its task runs and logs, cite the run and relevant errors, and explain what I should check before retrying. Do not retry or change anything.
First, your agent finds the failed run and the task where execution stopped.
The answer is in the logs.
The sample run loaded its input, then failed while validating the columns.
The file was found. The required column wasn’t.
Fix the input.
Then consider a retry.
In this example, retrying the same file would hit the same validation error.
Check the upstream export for customer_id. Restore that column, validate the file, and check for partial writes before rerunning.
A recommendation—not an automatic change or retry.
Illustrative walkthrough with sample data. No live workspace is connected to this page.