---
name: metabase_list_snippets
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def metabase_list_snippets(client: MetabaseClient, archived: bool = False) -> list[dict]"
description: "Lista SQL snippets reutilizables de Metabase. Un snippet se referencia en queries con {{snippet: nombre}}."
tags: [metabase, snippet, 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: archived
    desc: "si True, incluye snippets archivados (default False)"
output: "list[dict]: snippets con id, name, content, description, collection_id, creator_id, archived, created_at, updated_at"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/metabase/snippets.py"
---

## Ejemplo

```python
snippets = metabase_list_snippets(client)
for s in snippets:
    print(s["name"], len(s["content"]))

# Incluir archivados
all_snippets = metabase_list_snippets(client, archived=True)
active = [s for s in all_snippets if not s["archived"]]
```

## Notas

Si `archived=True` agrega el query param `?archived=true`.
Retorna lista directa de todos los snippets accesibles.
Los snippets archivados no aparecen en el autocomplete de queries de Metabase.
