Skip to content

fix(server): prefix maxToolInputElements error with Input validation error: - #3118

Draft
Jihaochang1 wants to merge 2 commits into
modelcontextprotocol:mainfrom
Jihaochang1:fix/3113-input-validation-prefix
Draft

Jihaochang1 wants to merge 2 commits into
modelcontextprotocol:mainfrom
Jihaochang1:fix/3113-input-validation-prefix

Conversation

@Jihaochang1

Copy link
Copy Markdown

Summary

  • prefix maxToolInputElements refusals with Input validation error:
  • consistent with existing pattern at line 374 for parseResult errors

Related to #3113 (already resolved by another contributor)

…idation error:'

Consistent with existing pattern at line 374 where parseResult.error
is also prefixed with 'Input validation error:'.
@changeset-bot

changeset-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cf55a34

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/server Patch
@modelcontextprotocol/client Patch
@modelcontextprotocol/codemod Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/core-internal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude claude Bot added the v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes label Oct 28, 2026
@arhancanli

Copy link
Copy Markdown

Read the diff against main (static read, I did not run the suite). The existing budget tests in packages/server/test/server/toolInputElementBudget.test.ts only assert toContain('more than the maximum') (lines 63, 97, 128), so they pass with or without the new prefix and nothing pins it. The schema-failure prefix is pinned in mcp.test.ts (stringContaining('Input validation error: Invalid arguments for tool test')), so a one-line assertion on the budget path, e.g. toContain('Input validation error: Invalid arguments for tool') next to the line-63 check, would keep the two paths from drifting apart again. Small nit: the changeset text refers to 'line 374', which will go stale; naming validateToolInput is more durable.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants