Skip to main content
Glama

execute

Destructive

Execute SQL queries or run saved Metabase cards to retrieve up to 500 rows of data from databases, with options for custom queries or predefined card filters.

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
database_idNoDatabase ID to execute query against (SQL mode only)
queryNoSQL query to execute (SQL mode only)
card_idNoID of saved card to execute (card mode only)
native_parametersNoParameters for SQL template variables like {{variable_name}} (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"}
row_limitNoMaximum number of rows to return (default: 100, max: 500). For larger datasets, use the export tool.
Behavior5/5

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

The description adds significant behavioral context beyond annotations. While annotations indicate destructiveHint=true and readOnlyHint=false, the description elaborates with a 'SECURITY WARNING' detailing that SQL mode can execute destructive operations (DELETE, UPDATE, etc.) and mentions the 'Read-Only Mode' limitation where write operations are rejected. It also specifies the row limit (500 rows) and fallback to the export tool, which annotations don't cover.

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?

The description is well-structured and concise, with every sentence adding value. It starts with the core purpose, then provides mode guidelines, row limit constraints, security warnings, and system limitations. There's no redundant information, and the front-loaded content immediately informs the agent about key operational aspects.

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's complexity (destructive operations, multiple modes, security implications) and the absence of an output schema, the description provides complete context. It covers purpose, usage guidelines, behavioral risks (destructive operations, read-only mode), performance constraints (row limits), and alternatives. The annotations support this with hints, but the description fills in critical details needed for safe and effective use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 6 parameters thoroughly. The description doesn't add any parameter-specific details beyond what's in the schema (e.g., it doesn't explain parameter interactions or provide examples). However, it implicitly references modes (Card vs SQL) that map to parameter groups, offering some high-level context. Baseline 3 is appropriate given the comprehensive schema coverage.

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?

The description clearly states the tool's purpose: 'execute SQL queries or run saved cards against Metabase databases.' It specifies two distinct modes (Card mode and SQL mode) and distinguishes itself from sibling tools like 'export' by mentioning the row limit constraint. The verb 'execute' is specific and the resource 'Metabase databases' is well-defined.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use each mode: 'Use Card mode when existing cards have the needed filters. Use SQL mode for custom queries or when cards lack required filters.' It also specifies when to use an alternative tool: 'for larger datasets, use the export tool instead.' This covers both mode selection and tool alternatives comprehensively.

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