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

The `maxToolInputElements` refusal lacks the `Input validation error:` prefix that the schema refusal carries

Đang mở Phù hợp với người mới
#3,111 3 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 1 ngày

@barry166 đang làm issue này rồi.

Từ ngày 27/10/2026.

  • #3113 của @barry166 — đang mở

Đánh giá

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

Hướng nghiên cứu

Bắt đầu tại packages/server/src/server/mcp.ts và đọc McpServer.validateToolInput, so sánh thông báo từ chối do giới hạn kích thước với thông báo từ chối do xác thực schema được mô tả trong issue. Cập nhật câu chữ từ chối do kích thước để có tiền tố dùng chung, sau đó kiểm tra các bài test server liên quan đến cả hai thông báo từ chối. Hoàn tất khi thông báo từ chối do kích thước bắt đầu bằng Input validation error: và vẫn giữ các chi tiết hiện có.

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

Mô tả

v1 v2

Version: @modelcontextprotocol/sdk 1.32.2 (the same text is in packages/server/src/server/mcp.ts on main).

McpServer.validateToolInput refuses a tool call in two ways. Both are McpError(ErrorCode.InvalidParams, …), and the tools/call handler returns either one as an isError: true result:

  • arguments over maxToolInputElements:
    Invalid arguments for tool start_run: arguments contain more than the maximum of 50000 elements
  • arguments that fail the input schema:
    Input validation error: Invalid arguments for tool get_run_state: Invalid input: expected string, received number at run_id

A client or a log filter that recognises an input refusal by its Input validation error: prefix misses the first one. Yet both are the same kind of refusal: bad arguments, same error code.

Suggestion: give the size refusal the same prefix:
Input validation error: Invalid arguments for tool start_run: arguments contain more than the maximum of 50000 elements

Context: we set maxToolInputElements: 50_000 in Realm's MCP server (thank you for #2926/#2927), and we document both texts for our users.

Related: #2879 asks for a hook to shape the schema refusal's result; if it lands, the size refusal could go through the same hook.

Ngôn ngữ chính
TypeScript
Star
13.7k
Fork
2.3k
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
53

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

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 modelcontextprotocol/typescript-sdk

Tất cả issue của modelcontextprotocol/typescript-sdk

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.