Migrate Cosmos DB to pagination

Đang mở
#4,331 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
azure, csharp, github
Lĩnh vực
api, databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C#
Star
3.9k
Fork
689
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
143

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/mcp

Tất cả issue của microsoft/mcp

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.