Skip to content

Conversation

@souvikghosh04
Copy link
Contributor

The MCP describe_entities tool returns "ALL" for wildcard permissions, which confuses LLM consumers that need explicit operation lists.

Changes

Modified DescribeEntitiesTool.BuildPermissionsInfo() to expand EntityActionOperation.All:

  • Tables/Views: Expands to ["CREATE", "DELETE", "READ", "UPDATE"] via EntityAction.ValidPermissionOperations
  • Stored Procedures: Expands to ["EXECUTE"] via EntityAction.ValidStoredProcedurePermissionOperations

Example

Before:

{
  "name": "Todo",
  "permissions": ["ALL"]
}

After:

{
  "name": "Todo",
  "permissions": ["CREATE", "DELETE", "READ", "UPDATE"]
}
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: MCP describe_entities permissions value ALL needs to be expanded.</issue_title>
<issue_description>## What?

Models are confused by ALL.

{
  "entities": [
    {
      "name": "Todo",
      "description": "This table contains the list of todo items.",
      "fields": [ ],
      "permissions": [
        "ALL" // this is the problem
      ]
    }
  ],
  "count": 1,
  "mode": "full",
  "status": "success"
}

Solution

When table/view.

{
  "permissions: [
    "CREATE",
    "DELETE",
    "READ",
    "UPDATE"
  ]
}

When stored procedure.

{
  "permissions: [
    "EXECUTE"
  ]
}

</issue_description>

Comments on the Issue (you are @copilot in this section)

@souvikghosh04 souvikghosh04 marked this pull request as ready for review November 5, 2025 05:23
Copilot AI review requested due to automatic review settings November 5, 2025 05:23
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 enhances the BuildPermissionsInfo method in DescribeEntitiesTool to properly expand the EntityActionOperation.All wildcard permission into its constituent operations based on entity type.

Key changes:

  • Added early return for null permissions
  • Implemented entity-type-aware expansion of the "All" wildcard operation (EXECUTE for stored procedures, CREATE/READ/UPDATE/DELETE for regular entities)
  • Switched to case-insensitive string comparison for the permissions HashSet to avoid duplicates

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

@souvikghosh04 souvikghosh04 merged commit 3b48c49 into main Nov 5, 2025
17 checks passed
@souvikghosh04 souvikghosh04 deleted the Usr/sogh/copilot_describe_entities_perms branch November 5, 2025 18:45
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.

[Bug]: MCP describe_entities permissions value ALL needs to be expanded.

5 participants