Migrate Cosmos DB to pagination

Aperta
#4,331 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
azure, csharp, github
Ambito
api, databases

Direzione di ricerca

Read tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs, tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs, and docs/tool-pagination.md; inspect the reverted implementation in commit b3e1b2854 and verify its AOT dependency prerequisite against the current dependencies. Then trace the framework's cursor and nextCursor contract and the existing recorded tests. Done means bounded pages, validated cursors, preserved authorization and query validation, passing pagination and serialization tests, verified AOT compatibility, and updated command docs.

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

Descrizione

enhancement Performance server-Azure.Mcp tools-CosmosDB

Paginate Cosmos DB container queries

Context

ItemQueryCommand calls CosmosService.QueryItems, which reads the query iterator until completion with MaxItemCount = -1. Large result sets can make a single tool call expensive. An earlier pagination implementation was reverted in commit b3e1b2854 because its AOT library needed updating.

Work

  • Investigate the prior implementation and resolve or verify the AOT dependency prerequisite before adopting it; do not assume it works with the current dependency set.
  • Use the framework's cursor and nextCursor contract to expose a Cosmos query continuation. Preserve the existing result shape unless a deliberate compatibility decision says otherwise.
  • Bind the cursor to account, database, container, effective query, subscription, authentication method, tenant, and other fixed query inputs.
  • Decide how existing all-results behavior changes and document the page-size and continuation semantics.

Acceptance criteria

  • One request returns a bounded page rather than draining the iterator; first, continued, empty-with-continuation, and terminal pages are covered.
  • Reject invalid cursors and changed fixed arguments before dispatch. Preserve query validation and authorization.
  • Cover option binding and source-generated serialization in unit tests and follow every page in recorded tests; verify AOT compatibility and update command docs.

References

  • tools/Azure.Mcp.Tools.Cosmos/src/Commands/ItemQueryCommand.cs
  • tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs
  • docs/tool-pagination.md
Lingua principale
C#
Stelle
3.9k
Fork
689
Merge medio
2g 11h
PR unite (30g)
143

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/mcp

Tutte le issue di microsoft/mcp

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.