251
All tools

Query tables and metrics

Runs a query against a table or saved metric through the semantic layer and returns the results.

Updated Sep 27, 2026

query-metrics.md

Query tables and metrics

Runs a query against a table or saved metric through the semantic layer and returns the results.

Note: Returns at most 200 rows per request: pass the returned continuation_token back for the next page.

Set up

Use the first option your agent supports.

MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

{ "mcpServers": { "metabase": { "url": "https://{metabase_host}/api/metabase-mcp" } } }

Call the MCP tool query.

Server URL: https://{metabase_host}/api/metabase-mcp

Note: {metabase_host} is your Metabase's address without https://. An admin turns the MCP server on under Admin > AI > MCP.

API (official)

Note: {metabase_host} is your Metabase's address without https://; the key's group decides what it can read.

Before anything else, confirm access with the cheapest read-only call, like a list or a search. Never send or change anything to test access.

Rules

  • Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
  • Never print API keys.

Ways in

RouteSourceCallRequiredDocs
MCPOfficial · remotequeryOAuthDocs
APIOfficialPOST /api/agent/v1/queryAPI key in $METABASE_API_KEYDocs

Workflows using Query tables and metrics

No workflows yet
No published workflow uses Query tables and metrics yet.