Skip to content

Commit 8fc2f80

Browse files
Add default --limit to show tool (#284)
# Summary Closes #272. # Details - Set explicit value in Pydantic `Field` default param and remove `None` type - Extend prompt with guiding words of advice # Tests I don't have an OpenAI key to run `task:client` but was able to successfully use the MCP Inspector and test in Claude/Copilot/Cursor: Claude - on asking about the default values for show: <img width="599" height="683" alt="Screenshot 2025-08-13 at 9 48 51 AM" src="https://github.com/user-attachments/assets/fbac84b7-56a3-4d3b-a42e-aa2413f90bfa" /> GitHub Copilot and Cursor had the same results and limited the data: <img width="1101" height="360" alt="Screenshot 2025-08-13 at 10 13 58 AM" src="https://github.com/user-attachments/assets/959522d6-83bb-4eeb-b1a5-030b4f7a028b" /> --------- Co-authored-by: Devon Fulcher <24593113+DevonFulcher@users.noreply.github.com>
1 parent 6a32aa1 commit 8fc2f80

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Enhancement or New Feature
2+
body: Add default --limit to show tool
3+
time: 2025-08-13T07:08:37.699907-07:00

src/dbt_mcp/dbt_cli/tools.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ def test(
117117

118118
def show(
119119
sql_query: str = Field(description=get_prompt("dbt_cli/args/sql_query")),
120-
limit: int | None = Field(
121-
default=None, description=get_prompt("dbt_cli/args/limit")
122-
),
120+
limit: int = Field(default=5, description=get_prompt("dbt_cli/args/limit")),
123121
) -> str:
124122
args = ["show", "--inline", sql_query, "--favor-state"]
125123
# This is quite crude, but it should be okay for now
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Limit the number of rows that the data platform will return. Use this in place of a `LIMIT` clause in the SQL query.
1+
Limit the number of rows that the data platform will return. Use this in place of a `LIMIT` clause in the SQL query. If no limit is passed, use the default of 5 to prevent returning a very large result set.

0 commit comments

Comments
 (0)