Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#3,111 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@barry166 已经在做这个了。

开始于 2026年10月27日。

  • #3113 来自 @barry166 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

从packages/server/src/server/mcp.ts开始,阅读McpServer.validateToolInput,并比较因大小限制而拒绝与 issue 中描述的因 schema 验证而拒绝。更新大小限制拒绝的措辞,使其包含共用前缀,然后检查针对这两种拒绝消息的相关服务器测试。大小限制拒绝以Input validation error:开头并保留现有细节,即为完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
13.7k
派生
2.3k
平均合并
1 天 2 小时
30 天内合并 PR
61

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/typescript-sdk 的其他 Issue

查看 modelcontextprotocol/typescript-sdk 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。