Skip to main content
Glama
NiclasOlofsson

DBT Core MCP Server

build_models

Run seeds, models, snapshots, and tests in correct dependency order using dbt build, simplifying data pipeline management.

Instructions

Run dbt build (execute models and tests together in correct dependency order).

When to use: This is the recommended "do everything" command that runs seeds, models, snapshots, and tests in the correct order based on your DAG. It automatically handles dependencies, so you don't need to run load_seeds() → run_models() → test_models() separately.

How it works: Executes resources in dependency order:

  1. Seeds (if selected)

  2. Models (with their upstream dependencies)

  3. Tests (after their parent models complete)

  4. Snapshots (if selected)

State-based selection modes (uses dbt state:modified selector):

  • select_state_modified: Build only resources modified since last successful run (state:modified)

  • select_state_modified_plus_downstream: Build 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 exclude: Exclude selector select_state_modified: Use state:modified selector (changed resources only) select_state_modified_plus_downstream: Extend to state:modified+ (changed + downstream) full_refresh: Force full refresh of incremental models resource_types: Filter by resource types (model, test, seed, snapshot) fail_fast: Stop execution on first failure state: Shared state object injected by FastMCP

Returns: Build results with status, models run/tested, and timing info

See also: - run_models(): Run only models (no tests) - test_models(): Run only tests - load_seeds(): Run only seeds

Examples: # Full project build (first-time setup or comprehensive run) build_models()

# Build only what changed (efficient incremental workflow)
build_models(select_state_modified=True)

# Build changed resources + everything downstream
build_models(select_state_modified=True, select_state_modified_plus_downstream=True)

# Build specific model and its dependencies + tests
build_models(select="customers")

# Build all marts (includes their seed dependencies automatically)
build_models(select="tag:mart")

# Quick feedback: stop on first test failure
build_models(fail_fast=True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectNo
excludeNo
select_state_modifiedNo
select_state_modified_plus_downstreamNo
full_refreshNo
resource_typesNo
fail_fastNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations provided, but the description explains the execution order (seeds, models, tests, snapshots), state-based selection mechanics, and return values. It discloses all relevant behavioral traits without contradiction.

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?

Well-structured with sections (overview, when to use, how it works, args, returns, see also, examples). Every sentence adds value, and the length is appropriate for the tool's complexity.

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?

The description covers purpose, usage, parameters, behavior, return info, and provides multiple examples. Given 7 parameters and no annotations, it is fully complete and leaves no gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description explains each parameter in detail with examples (e.g., 'select: dbt selector syntax (e.g., "customers", "tag:mart", "stg_*")'). It adds significant meaning beyond the schema names.

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 'Run dbt build (execute models and tests together in correct dependency order)' and differentiates from siblings like run_models and test_models. It provides a specific verb+resource and scope.

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?

Explicitly states 'This is the recommended do everything command' and includes a 'See also' section listing alternative tools with their purposes. Examples cover full builds, incremental workflows, and specific selections.

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/NiclasOlofsson/dbt-core-mcp'

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