# view_flight_run
> Open a Flight run in the Flight Explainer, a live step-by-step view of what each step did, inside the AI agent.
Open a run of a [Flight](/concepts/flights) in the [Flight Explainer](/key-tasks/flights/observability/explain-flight-runs): 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`](../get-flight-run-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`](../get-flight-viz-guide).

## 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`](../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.

```json
{
  "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:

```json
{ "id": "80000000-0000-0000-0000-000000000001" }
```

Open run 42:

```json
{ "id": "80000000-0000-0000-0000-000000000001", "run_number": 42 }
```

A typical prompt:

```text
Run the orders_nightly Flight and show me how the run went.
```

The agent calls [`run_flight`](../run-flight), then `view_flight_run` with the returned run number.

## Related

- [Watch Flight run progress with the Flight Explainer](/key-tasks/flights/observability/explain-flight-runs) — add a chart and progress lines to a Flight.
- [`get_flight_viz_guide`](../get-flight-viz-guide) — Load the chart and progress-line convention.
- [`get_flight_logs`](../get-flight-run-logs) — Read a run's raw output.
- [`list_flight_runs`](../list-flight-runs) — Find run numbers.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmcp%2Fflights%2Fview-flight-run%2F&page_title=view_flight_run&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
