Skip to content

Conversation

@souvikghosh04
Copy link
Contributor

@souvikghosh04 souvikghosh04 commented Jan 22, 2026

Why make this change?

With custom tools, stored procedure entities could get listed in describe_entities even when they are configured as custom-tool-only (with dml-tools: false). This creates duplication since they already appear in tools/list. We need to filter stored procedures with dml-tools: false from describe_entities to avoid this duplication.

What is this change?

  • Added filtering logic to exclude stored procedure entities when dml-tools is explicitly set to false
  • The filtering ensures stored procedures are removed from describe_entities only when they are custom-tool-only (not available for DML operations)
  • Stored procedures with dml-tools: true (or null/default) continue to appear in describe_entities even if they have custom-tool: true, allowing dual exposure when needed

How was this tested?

  • Unit Tests
  • Manual Tests

Sample Request(s)

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "describe_entities"
  },
  "id": 1
}

@souvikghosh04 souvikghosh04 requested a review from Copilot January 22, 2026 08:14
@souvikghosh04 souvikghosh04 self-assigned this Jan 22, 2026
@souvikghosh04 souvikghosh04 added mssql an issue thats specific to mssql mcp-server labels Jan 22, 2026
@souvikghosh04 souvikghosh04 added this to the Jan 2026 milestone Jan 22, 2026
@souvikghosh04 souvikghosh04 linked an issue Jan 22, 2026 that may be closed by this pull request
@souvikghosh04 souvikghosh04 moved this from Todo to In Progress in Data API builder Jan 22, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents stored-procedure entities that are already exposed as dedicated custom MCP tools from being duplicated in the describe_entities response.

Changes:

  • Added filtering in DescribeEntitiesTool to skip stored procedures with entity.Mcp.CustomToolEnabled == true.
  • Added new MSTest coverage validating stored procedure filtering and ensuring tables/views remain unaffected.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Azure.DataApiBuilder.Mcp/BuiltInTools/DescribeEntitiesTool.cs Filters out custom-tool-enabled stored procedures from describe_entities results.
src/Service.Tests/Mcp/DescribeEntitiesFilteringTests.cs Adds tests verifying filtering behavior across stored procedures, tables/views, and nameOnly mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@souvikghosh04
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@JerryNixon
Copy link
Contributor

JerryNixon commented Jan 22, 2026

Desired logic

DML TOOLS = TRUE DML TOOLS = FALSE
CUSTOM TOOL = TRUE ✔ describe_entities
✔ tools/list
✘ describe_entities
✔ tools/list
CUSTOM TOOL = FALSE ✔ describe_entities
✘ tools/list
✘ describe_entities
✘ tools/list

@souvikghosh04 souvikghosh04 changed the title [MCP] Prevent duplicating tool list between custom tools and describe [MCP] Prevent duplicating entities between custom tools and describe_entities Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcp-server mssql an issue thats specific to mssql

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

MCP-CustomTool: describe_entities filtering

3 participants