Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

MCP tools/list fetched as a single page — tools beyond the first page are silently dropped

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

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu tại packages/opencode/src/mcp/index.ts và kiểm tra cả đường dẫn client.listTools() tiêu chuẩn lẫn đường dẫn yêu cầu listToolsLenient(), chú ý đến việc xử lý nextCursor. Thêm một test tools/list nhiều trang để xác minh rằng các tool từ mọi trang đều được thu thập và được giữ lại trong tập tool đã đăng ký cũng như cache.

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

Mô tả

Summary

The MCP client retrieves a server's tool list with a single tools/list request and never follows the nextCursor pagination marker. Any server that paginates its tool catalog will have every tool past the first page silently omitted — no error, no warning.

Details

Two code paths are affected, both in packages/opencode/src/mcp/index.ts:

  • Standard pathclient.listTools(). In @modelcontextprotocol/sdk@1.26.0 this issues a single request and does not loop over pagination:
    async listTools(params, options) {
      const result = await this.request({ method: 'tools/list', params }, ListToolsResultSchema, options);
      ...
    }
    
  • Lenient fallbacklistToolsLenient() calls client.request({ method: "tools/list", params: {} }, ...), a single request that ignores nextCursor even though LenientListToolsResultSchema models that field.

Because neither path advances the cursor, tools beyond the first page are dropped from the registered tool set and from the tool-list cache.

Impact

Minor→Medium. Only affects servers whose tool catalog is large enough to paginate; most servers return all tools in one page. When it does occur, the failure is silent — affected tools simply never appear.

Suggested fix

  • Loop on nextCursor, concatenating tools, in both the standard and lenient paths before returning/caching.
  • Add a test with a multi-page tools/list response to verify all pages are collected.
Ngôn ngữ chính
TypeScript
Star
813
Fork
134
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
65

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 AltimateAI/altimate-code

Tất cả issue của AltimateAI/altimate-code

Issue tương tự

Thêm issue về TypeScript

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.