Azure / Azure/data-api-builder

Mark MCP tools as readonly for M365 federated connector support.

Aperta
#3,798 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.5k
Fork
370
Merge medio
3g 22h
PR unite (30g)
9

Descrizione

## Title
MCP tools missing `annotations` (readOnlyHint/destructiveHint) required by MCP spec and consumers like M365 Copilot Federated Connectors

## Summary
DAB's built-in MCP DML tools (`describe_entities`, `read_records`, `aggregate_records`, and presumably `create_record`/`update_record`/`delete_record`) do not emit an `annotations` object in their `tools/list` response. This blocks integration with MCP consumers that require tool annotations for safety validation — specifically, Microsoft 365 Copilot's federated connector, which rejects or silently drops tools lacking `readOnlyHint`.

## Current behavior
`tools/list` response for built-in tools has no `annotations` field, e.g.:

```json
{
"name": "read_records",
"description": "...",
"inputSchema": { ... }
}
```
## Expected behavior

Each tool should include an annotations object per the MCP spec, e.g.:

```json
{
"name": "read_records",
"description": "...",
"inputSchema": { ... },
"annotations": {
"readOnlyHint": true
}
}
```
At minimum, describe_entities, read_records, and aggregate_records should be marked readOnlyHint: true. Any write tools (create_record, update_record, delete_record) should be marked readOnlyHint: false and destructiveHint set appropriately (true for delete/update, false for create).

## Impact

Without this, DAB's MCP server cannot be registered as a custom connector in Microsoft 365 Copilot (and likely other MCP consumers enforcing the same validation), since these platforms require explicit read-only annotations before allowing a tool to be surfaced/executed.

## Environment
DAB version: 2.x (MCP support)
Consumer: Microsoft 365 Copilot federated connector (custom MCP connector)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla risposta tools/list del server MCP e individua le definizioni integrate degli strumenti DML per describe_entities, read_records, aggregate_records, create_record, update_record e delete_record. Confronta il loro output con i requisiti delle annotazioni MCP, quindi verifica che gli strumenti di sola lettura e di scrittura espongano i valori previsti di readOnlyHint e destructiveHint.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
api
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.