view_flight_run
Open a run of a Flight in the Flight Explainer: the Flight's declared chart as a step-by-step view, each step colored by what the run did, with its timing, rows, effects, and errors.
In clients that support MCP apps, the Flight Explainer opens inline in the conversation and updates while the run executes:
Description
Use view_flight_run instead of get_flight_logs when you want to see how a run went in your preferred AI tool rather than read its raw output. The view also links to the run in the MotherDuck UI.
A Flight that declares a chart and prints @flight-run lines is drawn as a diagram. A Flight without a chart opens a run view of its timing, config, and log instead, and the result reports has_chart: false. To add a chart, load the convention with get_flight_viz_guide.
The CLI equivalent is motherduck flight explain, which prints the steps. --open also opens the run in the app.
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | The Flight UUID. |
run_number | integer | No | Sequential run number to open, from list_flight_runs. Omit for the most recent run. |
Output schema
The text result summarizes the run for the agent. The chart, log, config, and timing go to the Flight Explainer view, not into the conversation.
{
"success": boolean,
"flight_id": string,
"flight_name": string,
"run_number": number,
"flight_version": number,
"status": string, // Run status, for example SUCCEEDED or FAILED
"outcome": string|null, // "ok", "failed", or "cancelled"; null while the run is in progress
"exit_code": number|null,
"log_lines": number, // Log lines read for the view
"has_chart": boolean, // false when the run's version declares no chart
"truncated": boolean // true when the log was longer than the view reads
}
Example usage
Open the latest run:
{ "id": "80000000-0000-0000-0000-000000000001" }
Open run 42:
{ "id": "80000000-0000-0000-0000-000000000001", "run_number": 42 }
A typical prompt:
Run the orders_nightly Flight and show me how the run went.
The agent calls run_flight, then view_flight_run with the returned run number.
Related
- Watch Flight run progress with the Flight Explainer — add a chart and progress lines to a Flight.
get_flight_viz_guide— Load the chart and progress-line convention.get_flight_logs— Read a run's raw output.list_flight_runs— Find run numbers.