Skip to content

feat: add namespace to MCP tools #1647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mdesmet
Copy link
Contributor

@mdesmet mdesmet commented Apr 25, 2025

Overview

Problem

Describe the problem you are solving. Mention the ticket/issue if applicable.

Solution

Describe the implemented solution. Add external references if needed.

Screenshot/Demo

A picture is worth a thousand words. Please highlight the changes if applicable.

How to test

  • Steps to be followed to verify the solution or code changes
  • Mention if there is any settings configuration added/changed/deleted

Checklist

  • I have run this code and it appears to resolve the stated issue
  • README.md updated and added information about my change

Important

Add namespace property to McpTool type and update tools in server.ts with namespace: "dbt".

  • Types:
    • Add namespace property to McpTool type in types.ts.
  • Tools:
    • Add namespace: "dbt" to each tool in tools array in server.ts.
    • Affects tools like GET_PROJECTS, GET_COLUMNS_OF_MODEL, EXECUTE_SQL, and others.
  • Misc:
    • No changes to tool functionality or behavior.

This description was created by Ellipsis for acd6ea0. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • New Features
    • All tools now display an associated "dbt" namespace property for improved clarity in tool identification.

@mdesmet mdesmet requested a review from saravmajestic April 25, 2025 03:45
Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

The changes introduce a new required string property, namespace, to the McpTool type definition. All tool objects within the DbtPowerUserMcpServerTools class are updated to include the property "namespace": "dbt". This update is applied consistently to all tools, including those added conditionally. No changes are made to logic, error handling, or public entity signatures beyond the addition of the new property.

Changes

File(s) Change Summary
src/mcp/types.ts Added a required namespace: string property to the exported McpTool type definition.
src/mcp/server.ts Updated all tool objects to include "namespace": "dbt" in the tools array of the server.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to acd6ea0 in 1 minute and 26 seconds. Click for details.
  • Reviewed 144 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/mcp/server.ts:97
  • Draft comment:
    Consistently add the namespace 'dbt' to all MCP tools. Ensure that future tool additions also include this property to maintain consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/mcp/types.ts:10
  • Draft comment:
    Added 'namespace' property in McpTool type. This improves clarity for tool categorization.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
3. src/mcp/types.ts:10
  • Draft comment:
    Good update: Added an explicit 'namespace' property to the McpTool type. Optionally, consider using a union type for allowed namespace values for stronger type safety.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
4. src/mcp/server.ts:437
  • Draft comment:
    Typographical error: 'indivdual' should be corrected to 'individual' in the RUN_TEST tool description.
  • Reason this comment was not posted:
    Comment was on unchanged code.
5. src/mcp/server.ts:506
  • Draft comment:
    Typographical error: In the INSTALL_DEPS tool description, consider revising "dbt projects's packages.yml file" to "dbt project's packages.yml file" to improve clarity.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_vE4sLKIMtmoVmoCp

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@@ -94,6 +94,7 @@ export class DbtPowerUserMcpServerTools implements Disposable {

private tools: McpTool[] = [
{
namespace: "dbt",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting the constant dbt namespace into a shared constant (e.g. DBT_NAMESPACE) to reduce duplication and avoid potential typos.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/mcp/server.ts (1)

95-575: Consider documenting the purpose of the namespace

The namespace property has been consistently added to all tools with the value "dbt". However, there's no documentation explaining the purpose or usage of this property.

Consider adding a comment or documentation that explains how the namespace property is intended to be used (e.g., for grouping tools, disambiguation, filtering, etc.).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed7345b and acd6ea0.

📒 Files selected for processing (2)
  • src/mcp/server.ts (16 hunks)
  • src/mcp/types.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build (windows-latest)
  • GitHub Check: test (windows-latest)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (16)
src/mcp/types.ts (1)

9-17: LGTM: Type definition updated to include namespace property

The McpTool type definition has been correctly extended with a required namespace string property, which aligns with the PR's objective of adding namespace support to MCP tools.

src/mcp/server.ts (15)

95-207: Namespace property consistently added to the first tool

The "dbt" namespace has been correctly added to the tool definition, maintaining the required structure from the updated type definition.


208-230: Namespace property correctly added to GET_COLUMNS_OF_MODEL tool

The "dbt" namespace has been appropriately applied to this tool.


231-256: Namespace property correctly added to GET_COLUMNS_OF_SOURCE tool

The "dbt" namespace has been appropriately applied to this tool.


257-316: Namespace property added to conditional tools

The "dbt" namespace has been consistently applied to the tools that are conditionally included based on workspace configuration.


317-337: Namespace property correctly added to COMPILE_MODEL tool

The "dbt" namespace has been appropriately applied to this tool.


338-361: Namespace property correctly added to COMPILE_QUERY tool

The "dbt" namespace has been appropriately applied to this tool.


362-386: Namespace property correctly added to RUN_MODEL tool

The "dbt" namespace has been appropriately applied to this tool.


387-411: Namespace property correctly added to BUILD_MODEL tool

The "dbt" namespace has been appropriately applied to this tool.


412-432: Namespace property correctly added to BUILD_PROJECT tool

The "dbt" namespace has been appropriately applied to this tool.


433-455: Namespace property correctly added to RUN_TEST tool

The "dbt" namespace has been appropriately applied to this tool.


456-478: Namespace property correctly added to RUN_MODEL_TEST tool

The "dbt" namespace has been appropriately applied to this tool.


479-501: Namespace property correctly added to ADD_DBT_PACKAGES tool

The "dbt" namespace has been appropriately applied to this tool.


502-524: Namespace property correctly added to INSTALL_DEPS tool

The "dbt" namespace has been appropriately applied to this tool.


525-549: Namespace property correctly added to GET_CHILDREN_MODELS tool

The "dbt" namespace has been appropriately applied to this tool.


550-574: Namespace property correctly added to GET_PARENT_MODELS tool

The "dbt" namespace has been appropriately applied to this tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant