Commit d13bbde
Expand ALL permissions in MCP describe_entities to explicit operations (#2951)
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:**
```json
{
"name": "Todo",
"permissions": ["ALL"]
}
```
**After:**
```json
{
"name": "Todo",
"permissions": ["CREATE", "DELETE", "READ", "UPDATE"]
}
```
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *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`.
>
> ```json
> {
> "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.
>
> ```json
> {
> "permissions: [
> "CREATE",
> "DELETE",
> "READ",
> "UPDATE"
> ]
> }
> ```
>
> When stored procedure.
>
> ```json
> {
> "permissions: [
> "EXECUTE"
> ]
> }
> ```
> </issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
- Fixes #2935
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JerryNixon <[email protected]>1 parent d17122c commit d13bbde
File tree
1 file changed
+21
-4
lines changed- src/Azure.DataApiBuilder.Mcp/BuiltInTools
1 file changed
+21
-4
lines changedLines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
372 | 380 | | |
373 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
374 | 384 | | |
375 | | - | |
| 385 | + | |
376 | 386 | | |
377 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
378 | 395 | | |
379 | 396 | | |
380 | 397 | | |
| |||
0 commit comments