# MD_LIST_BUCKETS_FOR_SECRET


> List S3 buckets visible to a named MotherDuck secret.

`MD_LIST_BUCKETS_FOR_SECRET()` lists the S3 buckets visible to the named secret.

:::note
This function takes a **secret name**, not a bucket name. It supports `S3` secrets only.
:::

## Syntax

```sql
FROM md_list_buckets_for_secret('<secret_name>');
```

## Output

| Column Name | Data Type | Value |
|-------------|-----------|-------|
| `name` | VARCHAR | Bucket name |
| `creation_date` | DATE | Bucket creation date |
| `region` | VARCHAR | Bucket region |
| `arn` | VARCHAR | Bucket ARN, when available |

## Example usage

```sql
FROM md_list_buckets_for_secret('__default_s3');
```


---

## 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%2Fmd-list-buckets-for-secret%2F&page_title=MD_LIST_BUCKETS_FOR_SECRET&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.
