Give your AI agents access to Metabase.
Connecting your AI agents to the Metabase database integration enables automated SQL querying, report generation, and data exploration across your cloud or self-hosted instance.
- Explore database schemas: inspect tables, fields, and foreign keys before writing SQL queries.
- Execute read-only SQL: run SELECT statements and saved questions directly to fetch context.
- Organize analytics assets: search, create, and manage collections, questions, and dashboards automatically.
- Safeguard database operations: benefit from built-in query parsing that blocks write operations before execution.
Manual data extraction slows down business decisions and creates backlogs for data teams. This integration provides direct, structured access to your data warehouse, allowing agents to analyze tables, fetch key metrics, and assemble visual reporting assets autonomously.
Key Metabase data automation features
- Database schema inspection: list databases, inspect table schemas, and retrieve foreign key relationships to write accurate queries.
- Automated query execution: run read-only SQL queries or execute existing saved questions using dynamic filter parameters.
- Dashboard and collection management: create new collections, build dashboards, and attach saved questions sequentially to organize reports.
- Built-in query safety: automatically filter out write operations, multi-statement queries, and side-effect functions before sending commands.
Streamline analytics workflows
By allowing agents to handle routine reporting tasks, organizations eliminate manual query writing and accelerate insight delivery. AI agents can gather context, execute analytics, and publish updated reports directly to your workspace.
Learn More
Use Case Scenarios
Answering a business question without writing SQL from scratch. A marketing manager wants to know which campaigns drove the most signups last quarter, but the warehouse schema is unfamiliar. The assistant lists databases, pulls the relevant tables with get_database_schema, and uses get_table to check field types and foreign keys before drafting a query. It runs the SQL in Metabase and returns the rows, so the answer arrives in minutes instead of after a ticket to the data team.
Keeping a reporting dashboard current. An operations lead maintains a dashboard of weekly KPIs. Instead of rebuilding it by hand, the assistant runs existing saved questions with new date parameters through run_question, then uses get_dashboard to confirm the cards and filters are in place. When a new metric is needed, create_question saves the query and add_question_to_dashboard places it below the existing cards, one addition at a time, so no card overwrites another.
Organizing a crowded analytics workspace. A growing team has hundreds of saved questions spread across folders. The assistant uses search and list_collections to find duplicates and outdated dashboards, then create_collection sets up a clean folder structure for each team or project. list_collection_items shows exactly what sits inside each one.
Onboarding new analysts. A new hire needs to learn the company's data model. The assistant walks through list_databases, filters get_database_schema by schema name, and explains key tables with get_table. It then runs sample queries capped with LIMIT so results stay readable and the database is not overloaded.
Applications
-
Business intelligence and analytics teams: Speed up ad hoc analysis and self-service reporting by letting stakeholders ask questions in plain language while the assistant handles the Metabase plumbing.
-
Data engineering and warehouse teams: Explore large schemas with paginated table listings and foreign key lookups, and reduce repetitive requests for table documentation.
-
Startup and small business founders: Get instant answers about sales, churn, or inventory without hiring a dedicated analyst, using Metabase Cloud or a self-hosted instance.
-
Data education and bootcamps: Give learners a guided way to practice SQL against real databases, with schema exploration and saved questions that make results easy to compare.
-
Finance and operations reporting: Pull recurring reports through saved questions with parameters, and maintain shared dashboards and collections for month-end review.
Frequently Asked Questions
Does this integration work with self-hosted Metabase instances?
Yes, this integration supports both Metabase Cloud and self-hosted Metabase instances. You only need your Metabase instance URL and a valid API key to connect.
How does the integration protect against accidental database modifications when running SQL?
The run_sql_query action parses SQL before sending it to Metabase and refuses multi-statement queries, write operations (like DELETE or SELECT INTO), and functions with side effects. To guarantee complete protection against writes, we recommend configuring your database connection in Metabase with a read-only user.
Is there a limit on the number of rows returned when running queries?
Yes, Metabase caps returned query results at 2,000 rows. If you are querying large tables, use aggregation or add explicit LIMIT clauses to your queries.
What permissions are required for the API key?
The integration acts with the permissions of the Metabase user account associated with the API key. It will only be able to view, search, run, or create collections, questions, and dashboards that the user account has permissions to access.