dbt_deps
Install or update external package dependencies for a dbt project. Ensures required modules, macros, and models are available before project execution.
Instructions
Install dbt package dependencies. An AI agent should use this tool when it needs to install or update external packages that the dbt project depends on. This ensures that all required modules, macros, and models from other packages are available before running the project.
Returns:
Output from the dbt deps 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:285-309 (handler)The MCP tool handler for 'dbt_deps'. Decorated with @mcp.tool() for registration. Includes input schema via Pydantic Field annotations. Executes the 'dbt deps' command using shared execute_dbt_command helper and processes the result.@mcp.tool() async def dbt_deps( 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: """Install dbt package dependencies. An AI agent should use this tool when it needs to install or update external packages that the dbt project depends on. This ensures that all required modules, macros, and models from other packages are available before running the project. Returns: Output from the dbt deps command as text (this command does not support JSON output format) """ command = ["deps"] # 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="deps")
- src/cli.py:442-442 (registration)CLI command registration mapping 'deps' to run_dbt_deps function (non-MCP)."deps": run_dbt_deps,
- src/tools.py:306-309 (helper)Calls to shared helpers execute_dbt_command and process_command_result used in dbt_deps implementation.result = await execute_dbt_command(command, project_dir, profiles_dir) # Use the centralized result processor return await process_command_result(result, command_name="deps")