Skip to content

Commit 5b3ae0c

Browse files
committed
Add missing selector and update prompt
1 parent bb1ce67 commit 5b3ae0c

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Bug Fix
2+
body: Add the missing selector argument when running commands
3+
time: 2025-06-03T17:03:27.888408+02:00

src/dbt_mcp/dbt_cli/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def build(
4343
default=None, description=get_prompt("dbt_cli/args/selectors")
4444
),
4545
) -> str:
46-
return _run_dbt_command(["build"])
46+
return _run_dbt_command(["build"], selector)
4747

4848
@dbt_mcp.tool(description=get_prompt("dbt_cli/compile"))
4949
def compile() -> str:
@@ -59,7 +59,7 @@ def ls(
5959
default=None, description=get_prompt("dbt_cli/args/selectors")
6060
),
6161
) -> str:
62-
return _run_dbt_command(["list"])
62+
return _run_dbt_command(["list"], selector)
6363

6464
@dbt_mcp.tool(description=get_prompt("dbt_cli/parse"))
6565
def parse() -> str:
@@ -71,15 +71,15 @@ def run(
7171
default=None, description=get_prompt("dbt_cli/args/selectors")
7272
),
7373
) -> str:
74-
return _run_dbt_command(["run"])
74+
return _run_dbt_command(["run"], selector)
7575

7676
@dbt_mcp.tool(description=get_prompt("dbt_cli/test"))
7777
def test(
7878
selector: Optional[str] = Field(
7979
default=None, description=get_prompt("dbt_cli/args/selectors")
8080
),
8181
) -> str:
82-
return _run_dbt_command(["test"])
82+
return _run_dbt_command(["test"], selector)
8383

8484
@dbt_mcp.tool(description=get_prompt("dbt_cli/show"))
8585
def show(sql_query: str, limit: int | None = None) -> str:

src/dbt_mcp/prompts/dbt_cli/args/selectors.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
It is important to add the `--select` before the selector if any selector needs to be provided
1+
It is important to add the `--select` before the selector if any selector needs to be provided.
2+
If you provide a selector, DO NOT forget adding `--select` in front!
23

34
- to select all models, just do not provide a selector.
45
- to select a particular model, use the selector `--select <model_name>`

0 commit comments

Comments
 (0)