# get_flight
> Fetch a Flight's metadata and version snapshot by UUID, optionally at a specific historical version.
Fetch a single [Flight](/concepts/flights). Returns Flight metadata plus the content of a specific version (source code, requirements, config, secret names, token name). Omit `version` for the current version; pass a 1-indexed `version` to inspect history.

## Description

The `get_flight` tool combines metadata and version content into one response, so the assistant does not need separate calls for "find the Flight" and "read its source." Use it to inspect a Flight before editing, or to read the source that ran for a specific past run.

Users can fetch Flights they have created. [Admins](/concepts/roles-and-access-control/) can fetch Flights they own as well as any Flight in the organization. The ability to edit, run, and delete a Flight is restricted to the Flight creator.
The SQL equivalent is [`MD_GET_FLIGHT`](/sql-reference/motherduck-sql-reference/flights/md-get-flight) plus [`MD_GET_FLIGHT_VERSION`](/sql-reference/motherduck-sql-reference/flights/md-get-flight-version).

## Input parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string (UUID) | Yes | The Flight UUID. |
| `version` | integer | No | 1-indexed version number. Omit for the current version. |

## Output schema

```json
{
  "success": boolean,
  "flight": {
    "flight_id": string,
    "flight_name": string,
    "created_at": string,
    "updated_at": string,
    "schedule_cron": string|null,
    "status": string,
    "schedule_status": string|null,
    "current_version": number,
    "owner_name": string|null,       // The user who owns the Flight
    "version_info": {
      "version_id": string,
      "flight_id": string,
      "version": number,
      "created_at": string,
      "source_code": string,
      "requirements_txt": string|null,
      "config": { "<key>": "<value>" },
      "access_token_name": string,
      "flight_secret_names": string[],
      "max_runtime_sec": number      // Per-run timeout in seconds; 0 means none
    }
  },
  "error": string
}
```

## Example usage

Inspect the current Flight:

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

Inspect version 2:

```json
{ "id": "80000000-0000-0000-0000-000000000001", "version": 2 }
```

## Related

- [`list_flight_versions`](../list-flight-versions) — Find available version numbers.
- [`list_flight_runs`](../list-flight-runs) — Each run includes the version it ran against.
- [`MD_GET_FLIGHT`](/sql-reference/motherduck-sql-reference/flights/md-get-flight) — SQL equivalent for current summary.


---

## 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%2Fget-flight%2F&page_title=get_flight&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.
