Skip to content

fix(client): return input_required from callTool before output-schema validation - #3217

Open
prassu017 wants to merge 1 commit into
modelcontextprotocol:mainfrom
prassu017:fix/call-tool-input-required-output-schema
Open

prassu017 wants to merge 1 commit into
modelcontextprotocol:mainfrom
prassu017:fix/call-tool-input-required-output-schema

Conversation

@prassu017

Copy link
Copy Markdown

Fixes #3216

In manual mode, callTool threw on the first round for a tool with an outputSchema, because the input_required result has no structuredContent yet. The output check now skips that intermediate result and still validates the completed one from the retry.

Tests: added a case to inputRequiredEngine.test.ts that fails on main with the error from the issue and passes with the fix. vitest run test/client/ in packages/client passes, apart from the four tests that build dist first (they need pnpm on PATH, which my sandbox lacks). Prettier and ESLint are clean on the changed lines; I didn't run the full typecheck.

… validation

A tool with an outputSchema made callTool({ allowInputRequired: true }) throw on the
first round, because the intermediate input_required result has no structuredContent.
Validate only the completed result.

Fixes modelcontextprotocol#3216
@changeset-bot

changeset-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cf2455b

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

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/client Patch
@modelcontextprotocol/codemod Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/server 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

@pkg-pr-new

pkg-pr-new Bot commented Nov 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@3217

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@3217

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@3217

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@3217

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@3217

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@3217

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@3217

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@3217

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@3217

commit: cf2455b

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2] client.callTool rejects an input_required result when the tool declares outputSchema (manual mode)

1 participant