Agent skill
data-metabase
Metabase REST API automation: auth, export/upsert cards and dashboards, visualization_settings. Use when scripting Metabase via API.
Install this agent skill to your Project
npx add-skill https://github.com/vasilyu1983/AI-Agents-public/tree/main/frameworks/shared-skills/skills/data-metabase
SKILL.md
Metabase
Automate Metabase via API: reports (cards), dashboards, and chart settings.
Quick Start
Inputs (env vars)
METABASE_URL(e.g.,https://metabase.example.com)- Preferred:
METABASE_API_KEY - Fallback:
METABASE_USERNAME+METABASE_PASSWORD
Sanity checks
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py health
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py whoami
Live API documentation
Your Metabase instance serves OpenAPI docs at /api/docs (e.g., https://metabase.example.com/api/docs). Use this to discover version-specific endpoints and request shapes.
Workflow
- Confirm API availability (
GET /api/util/health). - Authenticate with an API key (preferred) or a short-lived session (fallback).
- Discover IDs (prefer discovery over hardcoding across environments):
collection_idfor where to savedatabaseid fordataset_querysource-table/ field ids if using MBQL
- Create/update a card:
- Prefer native SQL for stable automation.
- Set
display+visualization_settingsexplicitly.
- Create/update a dashboard and add cards with consistent layout.
- Validate by running/exporting results.
Key Concepts
- UI "Question" == API
card - Chart configuration lives on the card as
display+visualization_settings - Most viz keys are easiest to manage by copying from an existing card JSON, then editing
Guardrails
- Prefer Metabase "serialization" (Pro/Enterprise) for bulk, cross-environment migrations; use direct API for incremental upserts.
- Do not hardcode numeric IDs across environments when you can discover them or use serialization/entity IDs.
- Never commit
METABASE_API_KEY, passwords, or session tokens. - Prefer a dedicated, least-privileged automation account and collection.
References (read only as needed)
| Topic | File |
|---|---|
| Authentication (API key + fallback) | references/api-auth.md |
| Reports (cards): create/edit patterns | references/reports-cards.md |
| Dashboards and card placement | references/dashboards.md |
Charts and visualization_settings |
references/charts-settings.md |
| Embedding & external integration | references/embedding-integration.md |
| Permissions & collections management | references/permissions-collections.md |
| Native SQL query patterns | references/native-query-patterns.md |
Scripts
scripts/metabase_api.py is a small, dependency-free helper to test auth and upsert cards.
Examples:
# Print authenticated user (tries API key, then session)
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py whoami
# Export an existing card JSON (use as a template for visualization_settings)
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py export-card --id 123 --out card.json
# Export an existing dashboard JSON (use as a template for layout)
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py export-dashboard --id 5 --out dashboard.json
# Create/update a card from a JSON spec (see references/reports-cards.md)
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py upsert-card --spec card-spec.json
# Create/update a dashboard from a JSON spec (base fields only)
python3 frameworks/shared-skills/skills/data-metabase/scripts/metabase_api.py upsert-dashboard --spec dashboard-spec.json
Fact-Checking
- Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
- Prefer primary sources; report source links and dates for volatile information.
- If web access is unavailable, state the limitation and mark guidance as unverified.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
software-localisation
Production-grade i18n/l10n for React, Vue, Angular, and Next.js with ICU format and RTL support. Use when setting up or debugging localisation.
ops-nuke-cicd
Design, implement, and troubleshoot NUKE-based CI/CD pipelines for .NET services with fast local-to-CI feedback loops. Use when creating or refactoring `nuke/Build.cs` target graphs, tuning `DependsOn`/`After`/`Triggers`/`OnlyWhenDynamic` behavior, orchestrating unit/API/DB test categories, merging and publishing coverage and test reports, building and pushing Docker images with traceable tags and digests, producing artifact contracts such as `deploy.env`, and diagnosing flaky or slow pipeline execution. For service code changes use $software-csharp-backend, for NUnit fixture design use $qa-testing-nunit, and for safe logging rewrites use $dev-structured-logs.
qa-debugging
Systematic debugging for crashes, regressions, flakes, and production bugs. Use when diagnosing stack traces, logs, traces, or profiling data.
ai-llm
Full LLM lifecycle skill — strategy selection, PEFT/LoRA, evaluation, and deployment. Use when building, fine-tuning, or operating LLM systems.
qa-testing-playwright
E2E web testing with Playwright. Use when writing tests, debugging flakes, or setting up CI with selectors, sharding, and network mocking.
software-frontend
Production-grade frontend for Next.js, Vue, Angular, and Svelte. Use when building UI, fixing hydration errors, or setting up a new web project.
Didn't find tool you were looking for?