# MD_LIST_FLIGHTS
> List Flights with summary metadata.
Returns the summary metadata for every [Flight](/concepts/flights) the caller can see: Users can see Flights they have created. [Admins](/concepts/roles-and-access-control/) can see Flights they own as well as any Flight in the organization. Use the optional `LIMIT` and `OFFSET` parameters to page through large result sets.

## Syntax

```sql
SELECT * FROM MD_LIST_FLIGHTS(
    "LIMIT" := <n>,
    "OFFSET" := <n>,
    owner_only := <boolean>
);
```

## Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `LIMIT` | `UINTEGER` | No | `50` | Maximum number of Flights to return. |
| `OFFSET` | `UINTEGER` | No | `0` | Skip this many Flights before returning. |
| `owner_only` | `BOOLEAN` | No | `false` | Return only the Flights you own. Meaningful for Admins, who otherwise see the whole organization; for other users the result is the same either way. |

`LIMIT` and `OFFSET` collide with SQL keywords and must be quoted with double quotes when passed as named arguments.

## Return columns

| Column | Type | Description |
|---|---|---|
| `flight_id` | `UUID` | Flight identifier. |
| `flight_name` | `VARCHAR` | The Flight name. |
| `schedule_cron` | `VARCHAR` | Cron expression, or `NULL` for on-demand. |
| `schedule_status` | `VARCHAR` | Schedule state (for example, `SCHEDULE_STATUS_ACTIVE` or `SCHEDULE_STATUS_DISABLED`), or `NULL` when the Flight has no schedule. |
| `status` | `VARCHAR` | Flight status (for example, `JOB_STATUS_ACTIVE`). Not the schedule state — see `schedule_status`. |
| `current_version` | `UINTEGER` | Latest version number. |
| `created_at` | `TIMESTAMP WITH TIME ZONE` | Creation timestamp. |
| `updated_at` | `TIMESTAMP WITH TIME ZONE` | Last update timestamp. |
| `owner_name` | `VARCHAR` | The user who owns the Flight. |

Version-specific content (`source_code`, `requirements_txt`, `config`) is not on this row; query [`MD_GET_FLIGHT_VERSION`](../md-get-flight-version) when you need it.

:::note
The name column is `flight_name`, not `name`. Filter and project with `flight_name` (for example, `WHERE flight_name = 'hourly_metrics'`).
:::

## Examples

List all Flights:

```sql
SELECT flight_id, flight_name, schedule_cron, current_version
FROM MD_LIST_FLIGHTS();
```

Page through results:

```sql
SELECT flight_name
FROM MD_LIST_FLIGHTS("LIMIT" := 50, "OFFSET" := 100);
```

Find Flights with active schedules:

```sql
SELECT flight_name, schedule_cron
FROM MD_LIST_FLIGHTS()
WHERE schedule_cron IS NOT NULL;
```

As an Admin, group the organization's Flights by owner:

```sql
SELECT owner_name, count(*) AS flights
FROM MD_LIST_FLIGHTS()
GROUP BY owner_name
ORDER BY flights DESC;
```

Narrow the listing back to the Flights you own:

```sql
SELECT flight_name
FROM MD_LIST_FLIGHTS(owner_only := true);
```

## Related

- [`MD_GET_FLIGHT`](../md-get-flight) — Fetch a single Flight's summary.
- [`MD_LIST_FLIGHT_RUNS`](../md-list-flight-runs) — List a Flight's runs.
- [`list_flights` MCP tool](/sql-reference/mcp/) — AI-agent equivalent (supports a `keywords` filter).


---

## 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%2Fmotherduck-sql-reference%2Fflights%2Fmd-list-flights%2F&page_title=MD_LIST_FLIGHTS&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.
