Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

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)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix MCP describe_entities permissions value ALL Expand ALL permissions in MCP describe_entities to explicit operations Oct 29, 2025
Copilot AI requested a review from JerryNixon October 29, 2025 21:22
Copilot finished work on behalf of JerryNixon October 29, 2025 21:22
@JerryNixon JerryNixon marked this pull request as ready for review November 3, 2025 08:04
Copilot AI review requested due to automatic review settings November 3, 2025 08:04
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 expand the "ALL" wildcard permission into specific operations based on entity type. When an entity has the "ALL" permission, it now resolves to specific CRUD operations (Create, Read, Update, Delete) for regular entities or Execute for stored procedures, providing more explicit permission information to API consumers.

  • Adds logic to detect and expand "ALL" (wildcard) permissions
  • Differentiates between stored procedure entities (expand to Execute) and regular entities (expand to CRUD operations)
  • Maintains the existing behavior for explicit permissions

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

Copy link
Contributor

@souvikghosh04 souvikghosh04 left a comment

Choose a reason for hiding this comment

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

LGTM. Added a small optimization to get the valid permissions only once if entity is stored procedure.

@souvikghosh04
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 added this to the Nov 2025 milestone Nov 3, 2025
@souvikghosh04
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@Aniruddh25 Aniruddh25 enabled auto-merge (squash) November 4, 2025 15:04
auto-merge was automatically disabled November 4, 2025 15:58

Pull request was closed

@github-project-automation github-project-automation bot moved this from Todo to Done in Data API builder Nov 4, 2025
@souvikghosh04 souvikghosh04 reopened this Nov 4, 2025
@github-project-automation github-project-automation bot moved this from Done to Todo in Data API builder Nov 4, 2025
@souvikghosh04 souvikghosh04 enabled auto-merge (squash) November 4, 2025 15:59
@souvikghosh04
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04 souvikghosh04 moved this from Todo to Review In Progress in Data API builder Nov 4, 2025
@anushakolan
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 6 pipeline(s).

@souvikghosh04
Copy link
Contributor

This change is moved under a different PR- #2951 due to some issues with test pipeline. Once the new PR is approved and merged, this PR should be closed without merging.

@souvikghosh04 souvikghosh04 self-requested a review November 5, 2025 13:12
Copy link
Contributor

@souvikghosh04 souvikghosh04 left a comment

Choose a reason for hiding this comment

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

Awaiting PR #2951 to be merged. This PR should not be merged.

@souvikghosh04 souvikghosh04 marked this pull request as draft November 5, 2025 13:21
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Data API builder Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

5 participants