Skip to content

fix: disambiguate input-required results with metadata - #1103

Open
DaleSeo wants to merge 1 commit into
mainfrom
fix-input-required-meta
Open

fix: disambiguate input-required results with metadata#1103
DaleSeo wants to merge 1 commit into
mainfrom
fix-input-required-meta

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jul 30, 2026

Copy link
Copy Markdown
Member

Fixes #1094.

Motivation and Context

ServerResult is an untagged Serde union, and CallToolResult comes before InputRequiredResult. Since the CallToolResult deserializer accepted _meta without checking resultType, an intermediate result with metadata was incorrectly treated as an empty, completed tool call. As a result, its input requests and request state were dropped.

This PR prevents metadata-bearing InputRequiredResult values from being silently deserialized as completed tool results. It preserves legacy tool results that don't include resultType and adds regression coverage for both wire formats.

How Has This Been Tested?

Added coverage

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes labels Jul 30, 2026
@DaleSeo
DaleSeo marked this pull request as ready for review July 30, 2026 23:39
@DaleSeo
DaleSeo requested a review from a team as a code owner July 30, 2026 23:39
@DaleSeo DaleSeo self-assigned this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputRequiredResult with _meta silently deserializes as CallToolResult

1 participant