execute_native_query
Execute custom SQL queries directly against Metabase databases to retrieve data not available through existing saved cards. Run SELECT statements to perform ad-hoc analysis and extract specific information from your database.
Instructions
⚠️ [MODERATE RISK] Execute an ad-hoc native SQL query directly against a database. Use this when you need to run custom SQL that doesn't exist as a saved card. Risk: Moderate - executes arbitrary SQL (read-only with API key, but can be slow or resource-intensive). Always validate SQL before executing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| databaseId | Yes | The ID of the database to query | |
| query | Yes | The SQL query to execute (SELECT statements only recommended) |
Input Schema (JSON Schema)
{
"properties": {
"databaseId": {
"description": "The ID of the database to query",
"minimum": 1,
"type": "integer"
},
"query": {
"description": "The SQL query to execute (SELECT statements only recommended)",
"minLength": 1,
"type": "string"
}
},
"required": [
"databaseId",
"query"
],
"type": "object"
}