Skip to content

Conversation

@yaonyan
Copy link

@yaonyan yaonyan commented Jan 15, 2026

Summary

Select the correct schema (CreateMessageResultWithToolsSchema vs CreateMessageResultSchema) based on whether tools were provided in the request.

Motivation and Context

Standard validation was incorrectly rejecting tool call arrays in sampling results because it was always using the non-tool schema. This allows clients to correctly receive tool use content from models.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have read the MCP Documentation

@yaonyan yaonyan requested a review from a team as a code owner January 15, 2026 03:13
@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: b4614d1

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

This PR includes changesets to release 1 package
Name Type
@modelcontextprotocol/client 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
Copy link

pkg-pr-new bot commented Jan 15, 2026

Open in StackBlitz

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1387
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1387

commit: b4614d1

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.

1 participant