Skip to content

feat: add validate_output parameter to call_tool decorator#2013

Open
tanhaipeng wants to merge 1 commit intomodelcontextprotocol:v1.xfrom
tanhaipeng:v1.x
Open

feat: add validate_output parameter to call_tool decorator#2013
tanhaipeng wants to merge 1 commit intomodelcontextprotocol:v1.xfrom
tanhaipeng:v1.x

Conversation

@tanhaipeng
Copy link

@tanhaipeng tanhaipeng commented Feb 8, 2026

Resolve #1850

  • Add validate_output parameter (default: True) to control output schema validation
  • Optimize tool definition fetching to only retrieve when validation is needed
  • Update documentation to reflect new parameter behavior
  • Add comprehensive tests for validate_input and validate_output parameters
  • Maintain backward compatibility with default behavior

Motivation and Context

How Has This Been Tested?

Breaking Changes

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

Additional context

@tanhaipeng tanhaipeng force-pushed the v1.x branch 3 times, most recently from 0b1b2a2 to 740876c Compare February 8, 2026 02:30
- Add validate_output parameter (default: True) to control output schema validation
- Optimize tool definition fetching to only retrieve when validation is needed
- Update documentation to reflect new parameter behavior
- Add comprehensive tests for validate_input and validate_output parameters
- Maintain backward compatibility with default behavior
@tanhaipeng
Copy link
Author

@Kludex @maxisbey @felixweinberger Please help review

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