Skip to main content
Glama
dbt-labs
by dbt-labs

show

Execute SQL queries to debug and inspect data in dbt projects, with an optional limit parameter to control result size.

Instructions

dbt show executes an arbitrary SQL statement against the database and returns the results. It is useful for debugging and inspecting data in your dbt project. Use the limit argument in place of a SQL LIMIT clause

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
sql_queryYes

Implementation Reference

  • Handler function for the 'show' tool. Executes 'dbt show --inline <sql_query>' with optional limit, outputting JSON.
    def show(
        sql_query: str = Field(description=get_prompt("dbt_cli/args/sql_query")),
        limit: int = Field(default=5, description=get_prompt("dbt_cli/args/limit")),
    ) -> str:
        args = ["show", "--inline", sql_query, "--favor-state"]
        # This is quite crude, but it should be okay for now
        # until we have a dbt Fusion integration.
        cli_limit = None
        if "limit" in sql_query.lower():
            # When --limit=-1, dbt won't apply a separate limit.
            cli_limit = -1
        elif limit:
            # This can be problematic if the LLM provides
            # a SQL limit and a `limit` argument. However, preferencing the limit
            # in the SQL query leads to a better experience when the LLM
            # makes that mistake.
            cli_limit = limit
        if cli_limit is not None:
            args.extend(["--limit", str(cli_limit)])
        args.extend(["--output", "json"])
        return _run_dbt_command(args)
  • Input schema defined via Pydantic Field descriptions for sql_query (required str) and optional limit (int, default 5).
        sql_query: str = Field(description=get_prompt("dbt_cli/args/sql_query")),
        limit: int = Field(default=5, description=get_prompt("dbt_cli/args/limit")),
    ) -> str:
  • Registration of the 'show' tool in create_dbt_cli_tool_definitions as ToolDefinition with fn=show, description from prompt, and annotations indicating read-only, non-destructive, idempotent.
    ToolDefinition(
        fn=show,
        description=get_prompt("dbt_cli/show"),
        annotations=create_tool_annotations(
            title="dbt show",
            read_only_hint=True,
            destructive_hint=False,
            idempotent_hint=True,
        ),
    ),
  • ToolName enum member defining the name 'show' for configuration and toolsets.
    SHOW = "show"
  • 'show' tool included in DBT_CLI toolset for enable/disable configuration.
    ToolName.SHOW,
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool executes SQL and returns results, which is basic behavioral information. However, it doesn't mention important traits like whether this is read-only vs. potentially destructive, authentication needs, rate limits, error handling, or result format details.

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 perfectly concise with three sentences that each earn their place: states the core functionality, provides usage context, and explains a key parameter. It's front-loaded with the main purpose and wastes no words.

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

Completeness3/5

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

For a tool that executes arbitrary SQL with 2 parameters and no output schema, the description is moderately complete. It covers the basic purpose and one parameter's semantics, but lacks details on result format, error conditions, or safety considerations (especially important for SQL execution tools). No annotations exist to fill these gaps.

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 description coverage is 0%, so the description must compensate. It explains the 'limit' parameter's purpose: 'Use the limit argument in place of a SQL `LIMIT` clause,' which adds valuable semantic context beyond the schema's basic type information. However, it doesn't explain the 'sql_query' parameter beyond what's obvious from the name.

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: 'executes an arbitrary SQL statement against the database and returns the results.' It specifies the verb (executes), resource (SQL statement), and outcome (returns results). This distinguishes it from siblings like 'query_metrics' or 'get_all_models' which have more specific scopes.

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 provides clear context: 'useful for debugging and inspecting data in your dbt project.' It implies when to use this tool (for debugging/inspecting) but doesn't explicitly state when not to use it or name specific alternatives among siblings like 'query_metrics' for metric queries.

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

Related 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/dbt-labs/dbt-mcp'

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