Skip to main content
Glama

query_sql

Generate the SQL that Looker would run for a query, enabling review and debugging without actual execution.

Instructions

Generate the SQL that Looker would execute for a query, without actually running it. Useful for reviewing or debugging queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesLookML model name
viewYesExplore/view name
fieldsYesFields to select
filtersNoFilter expressions
sortsNoSort expressions
limitNoMaximum rows
dev_modeNoCompile the SQL against the dev workspace's LookML rather than production. Implied when ``branch`` is set.
branchNoProject branch to atomically swap to for this call (saved branch restored on exit). Requires project_id.
project_idNoLookML project ID — required with ``branch``
act_as_userNoOptional Looker user ID or email to impersonate for this call. Use to operate on another user's dev workspace (Looker dev mode is per-user-isolated) or to run as a dedicated CI service user. Requires sudo capability on the configured admin credentials. When omitted, the call uses the configured or gateway-provided identity.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description accurately states the tool does not execute the query, only generates SQL. This is a key behavioral trait, though it omits details like permission requirements or rate limits. Still, it provides sufficient transparency for safe use.

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?

Two sentences, front-loaded with the core action ('Generate the SQL'), no extraneous words. Every sentence adds value.

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

Completeness4/5

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

The description captures the primary use case and non-execution behavior. Since an output schema exists, return values are covered. The tool has many parameters but the schema descriptions handle them, so completeness is adequate though not exhaustive.

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 coverage is 100% with descriptions for all parameters. The description adds no parameter-specific meaning beyond what the schema provides, meeting the baseline expectation.

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 generates SQL without executing it, using specific verb 'Generate' and resource 'SQL'. It distinguishes from sibling tools like 'query' which runs queries, making its purpose unambiguous.

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?

The description says 'Useful for reviewing or debugging queries', implying appropriate use cases. However, it does not explicitly exclude situations or mention alternatives, lacking full when-not guidance.

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/Ultrathink-Solutions/looker-mcp-server'

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