Skip to main content
Glama

dbt_debug

Validate dbt project setup to troubleshoot configuration issues, check database connectivity, and verify dependencies before running models or tests.

Instructions

Run dbt debug to validate the project setup. An AI agent should use this tool when it needs to troubleshoot configuration issues, check database connectivity, or verify that all project dependencies are properly installed. This is essential for diagnosing problems before attempting to run models or tests.

    Returns:
        Output from the dbt debug command as text (this command does not support JSON output format)
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_dirNoABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.').
profiles_dirNoDirectory containing the profiles.yml file (defaults to project_dir if not specified)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'dbt_debug'. Executes 'dbt debug' command to validate dbt project configuration, database connectivity, and dependencies. Includes input schema via Pydantic Field validators.
    @mcp.tool()
    async def dbt_debug(
        project_dir: str = Field(
            default=".",
            description="ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.')"
        ),
        profiles_dir: Optional[str] = Field(
            default=None,
            description="Directory containing the profiles.yml file (defaults to project_dir if not specified)"
        )
    ) -> str:
        """Run dbt debug to validate the project setup. An AI agent should use this tool when it needs to troubleshoot configuration issues, check database connectivity, or verify that all project dependencies are properly installed. This is essential for diagnosing problems before attempting to run models or tests.
    
        Returns:
            Output from the dbt debug command as text (this command does not support JSON output format)
        """
        command = ["debug"]
    
        # The --no-print flag is not supported by dbt Cloud CLI
        # We'll rely on proper parsing to handle any print macros
    
        result = await execute_dbt_command(command, project_dir, profiles_dir)
    
        # Use the centralized result processor
        return await process_command_result(result, command_name="debug")
  • src/server.py:85-90 (registration)
    Registers all MCP tools (including dbt_debug) on the FastMCP server instance by calling register_tools(mcp). This is the entry point where the dbt_debug tool becomes available.
    # Create FastMCP server
    mcp = FastMCP("dbt-cli", log_level="ERROR")
    
    # Register tools
    register_tools(mcp)
  • Input schema definition for the dbt_debug tool using Pydantic Field with descriptions and defaults for project_dir and profiles_dir parameters.
    project_dir: str = Field(
        default=".",
        description="ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.')"
    ),
    profiles_dir: Optional[str] = Field(
        default=None,
        description="Directory containing the profiles.yml file (defaults to project_dir if not specified)"
    )
  • src/tools.py:25-25 (registration)
    The register_tools function where all MCP tools, including dbt_debug, are defined and registered via @mcp.tool() decorators.
    def register_tools(mcp: FastMCP) -> None:
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's purpose (diagnostic validation), output format (text rather than JSON), and when it should be used (before running other operations). It doesn't mention potential side effects, performance characteristics, or error handling, but provides sufficient context for safe usage.

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 efficiently structured with two focused paragraphs: the first explains purpose and usage guidelines, the second clarifies output format. Every sentence adds value without redundancy, and the information is appropriately front-loaded with the most important context first.

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 the tool's diagnostic nature, 100% schema coverage, and the presence of an output schema (implied by 'Has output schema: true'), the description provides complete context. It explains what the tool does, when to use it, and the output format, which is sufficient for this type of validation tool.

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 description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter-specific information beyond what's in the schema. This meets the baseline expectation when schema coverage is complete.

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 specific action ('Run dbt debug to validate the project setup') and distinguishes it from siblings by focusing on troubleshooting configuration issues, checking connectivity, and verifying dependencies. It explicitly contrasts with tools like dbt_run or dbt_test that execute models rather than diagnose problems.

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?

The description provides explicit guidance on when to use this tool ('when it needs to troubleshoot configuration issues, check database connectivity, or verify that all project dependencies are properly installed') and when not to use it ('before attempting to run models or tests'), clearly differentiating it from sibling tools that perform those execution tasks.

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/MammothGrowth/dbt-cli-mcp'

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