get_generated_sql

📝 [MODERATE RISK] Get the generated SQL for a query-builder card with parameters. Use this to see the actual SQL that Metabase generates from query builder parameters. Risk: Moderate - executes queries to generate SQL.

Server Metabase MCP Server mikela92/metabase-mcp-mab
Category Read
Risk class Low
Parameters 00 required

What get_generated_sql does on Metabase MCP Server

AI agents call get_generated_sql to retrieve information from Metabase MCP Server without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

Why get_generated_sql needs a policy

While the tool's primary function is to retrieve/display SQL (Read category), the mechanism involves executing queries against the database to generate that SQL. This elevates the risk from low to medium severity due to potential query performance impact and information disclosure, but it remains Read rather than Execute because the tool does not allow the user to execute arbitrary queries or modify data—it only…

From the tool's definition Tool description states it 'Get[s] the generated SQL' and 'see[s] the actual SQL that Metabase generates'. The tool retrieves and displays SQL code without executing it against the database.

Questions about get_generated_sql

What does the get_generated_sql tool do? +

📝 [MODERATE RISK] Get the generated SQL for a query-builder card with parameters. Use this to see the actual SQL that Metabase generates from query builder parameters. Risk: Moderate - executes queries to generate SQL. It is categorised as a Read tool in the Metabase MCP Server MCP Server, which means it retrieves data without modifying state.

How do I enforce a policy on get_generated_sql? +

Register the Metabase MCP Server MCP server in PolicyLayer and add a rule for get_generated_sql: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Metabase MCP Server. Nothing to install.

What risk level is get_generated_sql? +

get_generated_sql is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit get_generated_sql? +

Yes. Add a rate_limit block to the get_generated_sql rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block get_generated_sql completely? +

Set action: deny in the PolicyLayer policy for get_generated_sql. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides get_generated_sql? +

get_generated_sql is provided by the Metabase MCP Server MCP server (mikela92/metabase-mcp-mab). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

// LOOK UP ANOTHER SERVER

Every MCP server has a record like this.

Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.