dbt_debug
Validate dbt project setup by troubleshooting configurations, checking database connectivity, and ensuring dependencies are installed correctly. Essential for diagnosing issues 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
| Name | Required | Description | Default |
|---|---|---|---|
| profiles_dir | No | Directory containing the profiles.yml file (defaults to project_dir if not specified) | |
| project_dir | No | ABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.') | . |
Implementation Reference
- src/tools.py:259-284 (handler)The core handler implementation for the 'dbt_debug' MCP tool. It defines the input parameters with descriptions, executes the 'dbt debug' command, and processes the result using shared utilities.@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/tools.py:261-269 (schema)Pydantic Field definitions providing input schema validation and descriptions for the dbt_debug tool 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)" ) ) -> str:
- src/server.py:89-89 (registration)Invocation of register_tools(mcp) which defines and registers the dbt_debug tool (along with others) with the FastMCP server instance.register_tools(mcp)