# MD_LIST_DIVE_GRANTEES
> List the users, roles, and organization that can open a Dive, as a table function.
Returns who has `read` access to a [Dive](/key-tasks/dives). Anyone who can open the Dive can list its grants. Only the owner and organization Admins see grantee names. Others get `NULL` in `grantee_name`, as does an owner using a read-only token. For a Dive you can't open, the function fails with the same error as for a Dive that doesn't exist.

It returns the same rows as [`SHOW GRANTS ON DIVE`](/sql-reference/motherduck-sql-reference/dives/grant-read-on-dive), as a table function you can filter, join, and use in subqueries.

Use this function where `SHOW GRANTS` isn't accepted, such as a read-only connection or an AI agent's read-only `query` tool.

## Syntax

```sql
SELECT * FROM MD_LIST_DIVE_GRANTEES('<dive_id>'::UUID);
```

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `dive_id` | `UUID` | Yes | Identifier of the Dive, passed positionally. Cast a string literal with `::UUID`; a plain string fails with `No function matches`. |

## Return columns

| Column | Type | Description |
|---|---|---|
| `grantee_name` | `VARCHAR` | The username or role name. For an organization grant, the organization's name. `NULL` unless you're the owner or an Admin. |
| `grantee_type` | `VARCHAR` | `user`, `role`, or `organization`. |
| `privilege` | `VARCHAR` | `read`. |

## Examples

List who can open a Dive:

```sql
SELECT grantee_name, grantee_type
FROM MD_LIST_DIVE_GRANTEES('80000000-0000-4000-8000-000000000001'::UUID)
ORDER BY grantee_type, grantee_name;
```

Check whether a Dive is open to the whole organization:

```sql
SELECT count(*) > 0 AS org_wide
FROM MD_LIST_DIVE_GRANTEES('80000000-0000-4000-8000-000000000001'::UUID)
WHERE grantee_type = 'organization';
```

## Related

- [`GRANT READ ON DIVE`](/sql-reference/motherduck-sql-reference/dives/grant-read-on-dive): grant, revoke, and show `read` access.
- [Choose who can open a Dive](/key-tasks/dives/#choose-who-can-open-a-dive)


---

## 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%2Fdives%2Fmd-list-dive-grantees%2F&page_title=MD_LIST_DIVE_GRANTEES&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.
