Skip to content

Conversation

souvikghosh04
Copy link
Contributor

@souvikghosh04 souvikghosh04 commented Oct 10, 2025

Why make this change?

Closes on

What is this change?

This PR implements built-int tool execute_entity as part of built-in tools to support execution of stored procedures or functions.

  • Performs execute operation on a stored procedure or function entity
  • Supports both querying and mutation
  • entity (required) name and parameters (optional based on entity parameters signature) should be specified (see sample below)
  • Operation is performed based on permissions as configured in dab-config
  • Success or Failure message response is generated on execution of the delete operation

How was this tested?

  • Manual functional test using MCP inpector/HTTP client
  • Integration Tests
  • Unit Tests

Sample Request(s)

Execute stored procedure to read queries-

POST http://localhost:5000/mcp

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "execute_entity",
    "arguments": {
      "entity": "GetBook",
      "parameters": {
        "id": 1
      }
    }
  }
}

Execute stored procedure without parameters-

POST http://localhost:5000/mcp

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "execute_entity",
    "arguments": {
      "entity": "GetBooks"
    }
  }
}

@souvikghosh04 souvikghosh04 self-assigned this Oct 10, 2025
@souvikghosh04 souvikghosh04 added the mssql an issue thats specific to mssql label Oct 10, 2025
@souvikghosh04 souvikghosh04 added this to the Oct 2025 milestone Oct 10, 2025
@souvikghosh04 souvikghosh04 linked an issue Oct 10, 2025 that may be closed by this pull request
6 tasks
@souvikghosh04 souvikghosh04 moved this from Todo to In Progress in Data API builder Oct 10, 2025
@souvikghosh04 souvikghosh04 requested a review from Copilot October 10, 2025 07:12
Copy link
Contributor

@Copilot 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 implements the execute-entity built-in tool for the Model Context Protocol (MCP) to support execution of stored procedures or functions as DAB entities. The tool validates permissions, parses parameters, and executes stored procedures while providing comprehensive error handling.

  • Adds ExecuteEntityTool class with execute operations for stored procedures/functions
  • Implements parameter validation and authorization checks using existing DAB permissions
  • Provides detailed error handling for SQL Server and generic database exceptions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@souvikghosh04 souvikghosh04 requested a review from Copilot October 10, 2025 07:53
Copy link
Contributor

@Copilot 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 1 out of 1 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@souvikghosh04 souvikghosh04 changed the title [MCP] Fixes and Refactoring execute-entity [MCP] Fixes and Refactoring execute_entity Oct 13, 2025
Copy link
Contributor

@RubenCerna2079 RubenCerna2079 left a comment

Choose a reason for hiding this comment

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

Just left a few comments. I'll be waiting for the next PR with the refactoring :)

@souvikghosh04
Copy link
Contributor Author

/azp run

@souvikghosh04 souvikghosh04 enabled auto-merge (squash) October 17, 2025 06:46
@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@anushakolan
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@anushakolan
Copy link
Contributor

LGTM!!

@RubenCerna2079
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@RubenCerna2079
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@anushakolan
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 merged commit a090e37 into main Oct 20, 2025
9 of 11 checks passed
@souvikghosh04 souvikghosh04 deleted the Usr/sogh/execute-entity branch October 20, 2025 20:45
@github-project-automation github-project-automation bot moved this from In Progress to Done in Data API builder Oct 20, 2025
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: Done

Development

Successfully merging this pull request may close these issues.

[Enh]: Add DML tool: execute_entity

4 participants