with one click
metabase-query
Query Metabase for IAE employment data (project)
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Query Metabase for IAE employment data (project)
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Query Zendesk support tickets and comments for Emplois de l'Inclusion (read-only). (project)
Indicateurs du Réseau pour l'emploi (France Travail) — accès/présence en emploi, formation, recrutement, RSA, par territoire et par mois. Données agrégées, nationales, couvrant tout le réseau (pas seulement nos services). À distinguer d'autometa_tables_db.
Lire et écrire dans Notion — interroger une base de données ou une page, et publier des rapports. À utiliser dès qu'une demande référence une page/base Notion (URL app.notion.com, ou ancien notion.so).
Create a new dashboard (TDB) — scaffolds files and inserts a row in the dashboards table. Use this skill instead of writing files directly.
Update a dashboard's metadata (title, description, tags, flags, archive). MUST be invoked whenever the user wants to modify an existing dashboard — guarantees the right slug is targeted and reloads coding conventions.
Composer un system prompt riche en contexte métier et lancer un run autometa-jobs à partir de l'intention de l'utilisateur. À utiliser quand l'utilisateur veut une analyse autonome et longue (minutes à heures), trop lourde ou trop lente pour le chat interactif — par ex. « lance un job qui analyse tous les services Dora ».
| name | metabase_query |
| description | Query Metabase for IAE employment data (project) |
Query the Metabase instances for IAE (Insertion par l'Activite Economique) employment data.
Before querying, read the relevant documentation:
knowledge/metabase/ - Tables, schemas, data dictionaryknowledge/stats/dashboards/ - Dashboard cards with IDs and SQLknowledge/stats/cards/ - Cards grouped by topicAll queries are automatically logged. Use lib.query:
from lib.query import execute_metabase_query, CallerType
# Execute a SQL query
result = execute_metabase_query(
instance='stats', # or 'datalake', 'dora'
caller=CallerType.AGENT,
sql="SELECT COUNT(*) FROM candidatures WHERE etat = 'Candidature acceptee'",
database_id=2,
)
if result.success:
print(result.data) # {"columns": [...], "rows": [...], "row_count": N}
else:
print(f"Error: {result.error}")
# Execute a saved card/question
result = execute_metabase_query(
instance='stats',
caller=CallerType.AGENT,
card_id=7073,
)
For more control (searching cards, getting metadata), use get_metabase():
from lib.query import get_metabase
api = get_metabase(instance='stats')
# Execute SQL
result = api.execute_sql("SELECT 1")
print(result.to_markdown())
# Execute a saved card
result = api.execute_card(7073)
print(result.to_dicts())
# Get card SQL to understand/modify it
sql = api.get_card_sql(7073)
# Search for cards
cards = api.search_cards("candidatures")
for card in cards:
print(f"{card['id']}: {card['name']}")
Card metadata is also documented in:
knowledge/stats/dashboards/ - Dashboard cards with IDs and SQLknowledge/stats/cards/ - Cards grouped by topicCore query methods:
execute_sql(sql) - Run raw SQL queryexecute_card(card_id) - Run a saved questionDiscovery methods:
get_card(card_id) - Get card metadataget_card_sql(card_id) - Get SQL for any card (native or compiled)search_cards(query) - Search cards by name/descriptionlist_cards(collection_id) - List cards in a collectionlist_models() - List all model-type cards (datasets)get_dashboard(dashboard_id) - Get dashboard metadatalist_dashboards(collection_id) - List dashboards in a collection| Instance | URL | Database ID | Purpose |
|---|---|---|---|
| stats | stats.inclusion.beta.gouv.fr | 2 | IAE employment statistics |
| datalake | datalake.inclusion.beta.gouv.fr | 2 | Cross-product analytics |
| dora | metabase.dora.inclusion.gouv.fr | 2 | Dora services directory (structures, services, orientations) |
| data_inclusion | metabase.data.inclusion.gouv.fr | — | Modèles Metabase uniquement via list_metabase_models(instance="data_inclusion", ...) |