diff --git a/src/mcp/server.ts b/src/mcp/server.ts index e684f0288..73c5c306c 100644 --- a/src/mcp/server.ts +++ b/src/mcp/server.ts @@ -94,6 +94,7 @@ export class DbtPowerUserMcpServerTools implements Disposable { private tools: McpTool[] = [ { + namespace: "dbt", name: ToolName.GET_PROJECTS, description: `Returns detailed information about all available dbt projects including: - projectRoot: The root directory path of the dbt project @@ -205,6 +206,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.GET_COLUMNS_OF_MODEL, description: "Returns the column names and data types for a specified dbt model. Use this to understand a model's schema before querying it.", @@ -227,6 +229,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.GET_COLUMNS_OF_SOURCE, description: "Returns the column names and data types for a specified dbt source. Use this to understand a source's schema before querying it.", @@ -256,6 +259,7 @@ This must be called first to get the projectRoot parameter needed for all other .get("enableMcpDataSourceQueryTools", false) ? [ { + namespace: "dbt", name: ToolName.GET_COLUMN_VALUES, description: "Returns the distinct values for a specified column in a model or source. Use this to understand the data distribution and possible values in a column.", @@ -281,6 +285,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.EXECUTE_SQL, description: "Executes SQL queries against the database, returning processed results immediately. Use this to test queries and retrieve data from the database.", @@ -310,6 +315,7 @@ This must be called first to get the projectRoot parameter needed for all other ] : []), { + namespace: "dbt", name: ToolName.COMPILE_MODEL, description: "Converts a dbt model's Jinja SQL into raw SQL. Use this to inspect the generated SQL before executing it. Note: This does not validate if the SQL will run successfully.", @@ -330,6 +336,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.COMPILE_QUERY, description: "Compile query, this will only convert the Jinja SQL to SQL, not determine if the SQL actually works. If the compilation succeeds, use the execute SQL and validate the data.", @@ -353,6 +360,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.RUN_MODEL, description: "Executes a dbt model in the database. Use + for plusOperatorLeft to include parent models, and + for plusOperatorRight to include child models in the run.", @@ -377,6 +385,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.BUILD_MODEL, description: "Builds a dbt model in the database. Use + for plusOperatorLeft to include parent models, and + for plusOperatorRight to include child models in the build.", @@ -401,6 +410,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.BUILD_PROJECT, description: "Builds the dbt project, this will run seeds, models and all related tests", @@ -421,6 +431,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.RUN_TEST, description: "Run an indivdual test based on the test name in the dbt manifest.", @@ -443,6 +454,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.RUN_MODEL_TEST, description: "Run model tests, use this tool to run the existing tests defined for the dbt model", @@ -465,6 +477,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.ADD_DBT_PACKAGES, description: "Add dbt package(s) to the project, the dbt package string should be in the form of packageName@version", @@ -487,6 +500,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.INSTALL_DEPS, description: "Install dbt package dependencies based on the dbt projects's packages.yml file", @@ -509,6 +523,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.GET_CHILDREN_MODELS, description: "Returns the list of models that depend on the specified model (its children). Use this to understand a model's downstream impact and lineage.", @@ -533,6 +548,7 @@ This must be called first to get the projectRoot parameter needed for all other }, }, { + namespace: "dbt", name: ToolName.GET_PARENT_MODELS, description: "Returns the list of models that the specified model depends on (its parents). Use this to understand a model's upstream dependencies and lineage.", diff --git a/src/mcp/types.ts b/src/mcp/types.ts index afb25178b..22c5d3351 100644 --- a/src/mcp/types.ts +++ b/src/mcp/types.ts @@ -7,6 +7,7 @@ import { z } from "zod"; export type ToolInput = z.infer; export type McpTool = { + namespace: string; name: string; description: string; inputSchema: ToolInput;