---
name: metabase_list_databases
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def metabase_list_databases(client: MetabaseClient, include_tables: bool = False) -> list"
description: "Lista las databases configuradas en Metabase. Endpoint: GET /api/database. Soporta incluir tablas con include_tables=True."
tags: [metabase, database, list, api, python]
uses_functions: []
uses_types: [MetabaseClient_go_infra]
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [httpx]
params:
  - name: client
    desc: "instancia autenticada de MetabaseClient"
  - name: include_tables
    desc: "incluir lista de tablas en cada database"
output: "list[dict]: lista de databases configuradas con id, name, engine y opcionalmente tables"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/metabase/databases.py"
---

## Ejemplo

```python
dbs = metabase_list_databases(client)
for db in dbs:
    print(db["id"], db["name"], db["engine"])

# Con tablas incluidas
dbs = metabase_list_databases(client, include_tables=True)
for db in dbs:
    print(db["name"], [t["name"] for t in db.get("tables", [])])
```

## Notas

Si include_tables=True agrega el query param `?include=tables` al request.
Retorna lista directa (no paginada) de todas las databases accesibles.
