Skip to main content
Glama
Arkanji

metabase-mcp-server

by Arkanji

query_dataset

Run MBQL queries on Metabase databases to fetch data, using pagination to exceed the 2000-row hard limit for result sets up to 10,000 rows.

Instructions

Run an MBQL query against a Metabase database. Metabase enforces a hard server-side cap of 2000 rows — use aggregations to work around this. If is_truncated is true and you need more rows, call again with offset: 2000, then 4000, etc. Only do this for small result sets (<10K rows). For larger exports, use export_dataset instead. For time comparisons (WoW, MoM, trends), use a single query with a date breakout instead of multiple queries. MBQL examples: aggregation: [["count"]] or [["sum", ["field", 87, null]]]. filter: ["=", ["field", 10, null], "active"]. breakout: [["field", 42, {"temporal-unit": "month"}]].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoRow limit (max/default 2000 — Metabase hard cap)
filterNoMBQL filter clause, e.g. ["=", ["field", 135, null], 4]
offsetNoOffset for pagination (use with limit for small result sets <10K rows)
breakoutNoMBQL breakout fields for grouping, e.g. [["field", 91, null]]
table_idYesThe table ID (maps to source-table in MBQL)
aggregationNoMBQL aggregation clauses, e.g. [["count"], ["sum", ["field", 87, null]]]
database_idYesThe database ID
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the hard 2000-row server cap, pagination behavior, the is_truncated flag, and limits on pagination (<10K rows). It stops short of detailing error handling or auth, but adds important context beyond the schema.

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

Conciseness4/5

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

The description is dense but every sentence adds value: core action, limits, pagination strategy, alternatives, and examples. It is not as terse as an ideal high-score, but it is appropriately sized for the tool's complexity.

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 no output schema, the description includes key behavioral details (row cap, is_truncated, pagination) and directs users to alternative tools. It covers the essential operational knowledge needed to use this tool effectively, making it complete for its complexity.

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 a baseline of 3 is warranted. The description adds MBQL examples for aggregation, filter, and breakout, clarifying parameter syntax that would otherwise be cryptic. This exceeds the baseline.

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 opens with a clear, specific verb and resource: 'Run an MBQL query against a Metabase database.' It distinguishes itself from sibling tools (run_native_query, run_saved_question, export_dataset) by focusing on MBQL querying.

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?

Explicitly describes when to use alternatives: use export_dataset for large exports, use a date breakout for time comparisons, and use pagination only for small result sets (<10K rows). This gives clear decision criteria.

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/Arkanji/metabase-mcp-server'

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