Skip to main content
Glama

execute

Destructive

Execute SQL queries or run saved cards against Metabase databases to fetch data. Supports custom SQL and card parameters with configurable row limits.

Instructions

Unified command to execute SQL queries or run saved cards against Metabase databases. Use Card mode when existing cards have the needed filters. Use SQL mode for custom queries or when cards lack required filters. Returns up to 500 rows per request - for larger datasets, use the export tool instead. SECURITY WARNING: SQL mode can execute ANY valid SQL including destructive operations (DELETE, UPDATE, DROP, TRUNCATE, ALTER). Use with caution and ensure appropriate database permissions are configured in Metabase. Note: When Read-Only Mode is enabled, write operations will be rejected with an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSQL query to execute (SQL mode only)
card_idNoID of saved card to execute (card mode only)
row_limitNoMaximum number of rows to return (default: 100, max: 500). For larger datasets, use the export tool.
database_idNoDatabase ID to execute query against (SQL mode only)
card_parametersNoParameters for filtering card results (card mode only). Each parameter must follow Metabase format: {id: "uuid", slug: "param_name", target: ["dimension", ["template-tag", "param_name"]], type: "param_type", value: ["param_value"]}. For dimension targets, value should be an array; scalar values are accepted and auto-wrapped.
native_parametersNoParameters for SQL template variables like {{variable_name}} (SQL mode only)
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructiveHint=true and readOnlyHint=false. The description adds explicit security warnings about destructive SQL operations, mentions read-only mode rejection, and clarifies behavior for both modes. This goes beyond annotations to provide essential safety context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise (~150 words), front-loaded with primary purpose, then logically organizes modes, limitations, warnings, and exceptions. Every sentence serves a purpose—no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool complexity (dual modes, security concerns, no output schema), description covers all critical aspects: modes, parameters, row limits (and export alternative), security warning, and read-only mode handling. Leaves no major gaps for safe usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema documents all parameters. Description adds context by explaining the card_parameters format in detail and clarifying mode-specific parameters (e.g., database_id for SQL only). Slightly redundant on row_limit since schema already has bounds, but overall adds value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states it is a 'Unified command to execute SQL queries or run saved cards', specifying verb (execute) and resources (SQL queries, saved cards). Distinguishes two clear modes and sets expectations for row limits, making it highly specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides guidance on when to use Card vs SQL mode based on filter needs, and mentions export tool for larger datasets. However, it does not compare to sibling tools (clear_cache, search, retrieve, list) or state when not to use this tool, leaving room for ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jerichosequitin/metabase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server