run_models
Execute dbt models to compile SQL and run transformations against your database, updating tables and views with selective or state-based runs.
Instructions
Run dbt models (compile SQL and execute against database).
What are models: SQL files (.sql) containing SELECT statements that define data transformations. Models are compiled and executed to create/update tables and views in your database.
Important: This tool runs models only (SQL files). For CSV seed files, use load_seeds(). For running everything together (seeds + models + tests), use build_models().
State-based selection modes (uses dbt state:modified selector):
select_state_modified: Run only models modified since last successful run (state:modified)
select_state_modified_plus_downstream: Run modified + downstream dependencies (state:modified+) Note: Requires select_state_modified=True
Manual selection (alternative to state-based):
select: dbt selector syntax (e.g., "customers", "tag:mart", "stg_*")
exclude: Exclude specific models
Args: select: Manual selector (e.g., "customers", "tag:mart", "path:marts/*") exclude: Exclude selector (e.g., "tag:deprecated") select_state_modified: Use state:modified selector (changed models only) select_state_modified_plus_downstream: Extend to state:modified+ (changed + downstream) full_refresh: Force full refresh of incremental models fail_fast: Stop execution on first failure check_schema_changes: Detect schema changes and recommend downstream runs cache_selected_only: Only cache schemas for selected models (default True for performance) state: Shared state object injected by FastMCP
Returns: Execution results with status, models run, timing info, and optional schema_changes
See also: - seed_data(): Load CSV files (must run before models that reference them) - build_models(): Run models + tests together in DAG order - test_models(): Run tests after models complete
Examples: # Run a specific model run_models(select="customers")
# After loading seeds, run dependent models
seed_data()
run_models(select="stg_orders")
# Incremental: run only what changed
run_models(select_state_modified=True)
# Run changed models + everything downstream
run_models(select_state_modified=True, select_state_modified_plus_downstream=True)
# Full refresh marts (rebuild from scratch)
run_models(select="tag:mart", full_refresh=True)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| select | No | ||
| exclude | No | ||
| select_state_modified | No | ||
| select_state_modified_plus_downstream | No | ||
| full_refresh | No | ||
| fail_fast | No | ||
| check_schema_changes | No | ||
| cache_selected_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||