---
name: metabase_list_cards
kind: function
lang: go
domain: infra
version: "1.0.0"
purity: impure
signature: "func MetabaseListCards(client MetabaseClient, filter string, modelID int) ([]map[string]any, error)"
description: "Lista preguntas/cards de Metabase con filtro opcional. Retorna array de cards. Endpoint: GET /api/card."
tags: [metabase, card, question, list, api, pendiente-usar]
uses_functions: []
uses_types: [MetabaseClient_go_infra]
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [fmt]
params:
  - name: client
    desc: "cliente MetabaseClient autenticado"
  - name: filter
    desc: "filtro opcional (all, mine, fav, archived, recent, popular, database, table)"
  - name: modelID
    desc: "ID de database/tabla para filtros database/table (0 = ignorar)"
output: "slice de maps con detalles de cada card (ID, nombre, query, visualizacion)"
tested: false
tests: []
test_file_path: ""
file_path: "functions/infra/metabase_list_cards.go"
---

## Ejemplo

```go
// Listar todas las cards
cards, err := MetabaseListCards(client, "all", 0)

// Solo mis preguntas
cards, err := MetabaseListCards(client, "mine", 0)

// Cards de una database especifica
cards, err := MetabaseListCards(client, "database", 1)

// Cards archivadas
cards, err := MetabaseListCards(client, "archived", 0)
```

## Notas

### Parametros para un LLM

| Parametro | Tipo | Requerido | Descripcion |
|-----------|------|-----------|-------------|
| client | MetabaseClient | si | Cliente autenticado |
| filter | string | no | "all", "mine", "fav", "archived", "recent", "popular", "database", "table". Vacio = todas |
| modelID | int | no | ID de database/tabla. Solo aplica con filter "database" o "table". 0 = ignorar |

No tiene paginacion con offset/limit. Retorna todas las cards que coinciden.

### Campos principales de cada card

| Campo | Tipo | Descripcion |
|-------|------|-------------|
| id | float64 | ID numerico de la card |
| name | string | Nombre de la pregunta |
| description | string | Descripcion |
| display | string | Tipo de visualizacion (table, bar, line, pie, etc.) |
| collection_id | float64 | ID de la coleccion/carpeta |
| database_id | float64 | ID de la database |
| creator_id | float64 | ID del creador |
| archived | bool | Esta archivada |
| dataset_query | map | Query de la card (native o structured) |
