Skip to main content
Glama

dbt_compile

Generate SQL from dbt models to validate syntax, preview transformations, or explore model interpretations without executing queries against the database.

Instructions

Compile dbt models. An AI agent should use this tool when it needs to generate the SQL that will be executed without actually running it against the database. This is valuable for validating SQL syntax, previewing transformations, or investigating how dbt interprets models before committing to execution.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
excludeNoModels to exclude
modelsNoSpecific models to compile, using the dbt selection syntax
profiles_dirNoDirectory containing the profiles.yml file (defaults to project_dir if not specified)
project_dirNoABSOLUTE PATH to the directory containing the dbt project (e.g. '/Users/username/projects/dbt_project' not '.').
selectorNoNamed selector to use

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

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