Migrate Cosmos DB to pagination

オープン
#4,331 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
azure, csharp, github
領域
api, databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
C#
スター
3.9k
フォーク
689
平均マージ
2日 11時間
マージ済み PR(30日)
143

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/mcp のほかの issue

microsoft/mcp の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。