Migrate Cosmos DB to pagination

Abierto
#4,331 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
azure, csharp, github
Área
api, databases

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
C#
Estrellas
3.9k
Forks
689
Merge medio
2 d 11 h
PR fusionados (30 d)
143

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/mcp

Todos los issues de microsoft/mcp

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.