Skip to content

Conversation

@souvikghosh04
Copy link
Contributor

@souvikghosh04 souvikghosh04 commented Oct 9, 2025

Why make this change?

Closes on

Added fixes and refactored the describe_entities tool to support entity metadata discovery for AI agents and LLM clients before performing CRUD operations.

What is this change?

  • Expose entity descriptions with proper null handling
  • Expose field description for entities of type stored-procedure with parameter metadata
  • Expose permissions for all entities with distinct values
  • Added nameOnly parameter to return lightweight response (entity names and descriptions only)
  • Added entities parameter to filter results by specific entity names
  • Implemented proper error handling using McpResponseBuilder pattern
  • Added support for relationships, mappings, and primary key information
  • Improved response structure with metadata section including mode and count

How was this tested?

Functional testing using Insomnia client by running DAB in localhost and local SQL DB database

Expected (In-progress) format of entity description in response-

{
  "entities": [
    {
      "name": "entity-name",
      "description": "entity description",
      "type": "Table",
      "fields": [
        {
          "name": "field-name",
          "type": "unknown",
          "description": "field description"
        }
      ],
      "permissions": [
        "CREATE",
        "READ",
        "UPDATE",
        "DELETE"
      ],
      "primaryKey": ["id"],
      "relationships": [...],
      "mappings": {...}
    }
  ],
  "count": 1,
  "mode": "full"
}

Sample Request(s)

POST http://localhost:5000/mcp

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "describe_entities"
  },
  "id": 1
}
POST http://localhost:5000/mcp

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "describe_entities",
    "arguments": {
      "nameOnly": true
    }
  },
  "id": 2
}
POST http://localhost:5000/mcp

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "describe_entities",
    "arguments": {
      "entities": ["Book", "Publisher"]
    }
  },
  "id": 1
}

@souvikghosh04 souvikghosh04 changed the title [MCP] describe_entities tool [MCP] Refactoring and additional fixes to describe_entities tool Oct 9, 2025
@souvikghosh04 souvikghosh04 changed the title [MCP] Refactoring and additional fixes to describe_entities tool [MCP] describe_entities tool fixes and refactoring Oct 9, 2025
@souvikghosh04 souvikghosh04 marked this pull request as ready for review October 9, 2025 11:15
Copilot AI review requested due to automatic review settings October 9, 2025 11:15
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 renames the describe-entities tool to describe_entities and enhances its functionality to provide comprehensive entity metadata including descriptions, fields for stored procedures, and permissions.

  • Renamed tool from describe-entities to describe_entities across configuration and implementation
  • Enhanced entity response to include descriptions, fields for stored procedures, and permissions
  • Added proper documentation and error handling to the tool implementation

Reviewed Changes

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

Show a summary per file
File Description
src/Config/ObjectModel/DmlToolsConfig.cs Updated comments to reflect the new tool name
src/Config/Converters/DmlToolsConfigConverter.cs Updated JSON property name and validation logic
src/Cli/ConfigGenerator.cs Updated logging message to use new tool name
src/Cli/Commands/ConfigureOptions.cs Updated CLI option name for the tool
src/Azure.DataApiBuilder.Mcp/BuiltInTools/DescribeEntitiesTool.cs Major refactoring with enhanced functionality and documentation
schemas/dab.draft.schema.json Updated JSON schema property name and description

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

@souvikghosh04 souvikghosh04 self-assigned this Oct 9, 2025
@souvikghosh04 souvikghosh04 added this to the Oct 2025 milestone Oct 9, 2025
@souvikghosh04 souvikghosh04 added mssql an issue thats specific to mssql mcp-server labels Oct 9, 2025
@souvikghosh04 souvikghosh04 moved this from Todo to In Progress in Data API builder Oct 9, 2025
@souvikghosh04 souvikghosh04 moved this from In Progress to Review In Progress in Data API builder Oct 9, 2025
@souvikghosh04 souvikghosh04 linked an issue Oct 9, 2025 that may be closed by this pull request
11 tasks
@souvikghosh04 souvikghosh04 changed the title [MCP] describe_entities tool fixes and refactoring [MCP] describe-entities tool fixes and refactoring Oct 9, 2025
Copy link
Contributor

@anushakolan anushakolan left a comment

Choose a reason for hiding this comment

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

LGTM. I will test this with Claude to see if there are any other errors.

@souvikghosh04 souvikghosh04 changed the title [MCP] describe-entities tool fixes and refactoring [MCP] describe_entities tool fixes and refactoring Oct 13, 2025
@souvikghosh04
Copy link
Contributor Author

/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).

@RubenCerna2079 RubenCerna2079 enabled auto-merge (squash) October 24, 2025 22:25
@RubenCerna2079
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

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.

LGTM!

@RubenCerna2079 RubenCerna2079 dismissed Aniruddh25’s stale review October 24, 2025 23:52

The changes have been made

@RubenCerna2079 RubenCerna2079 merged commit 5ba8682 into main Oct 25, 2025
11 checks passed
@RubenCerna2079 RubenCerna2079 deleted the Usr/sogh/describe-entities branch October 25, 2025 00:34
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Data API builder Oct 25, 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: describe_entities

5 participants