Skip to content

Conversation

@antoniomdk
Copy link

Motivation and Context

  • When using MCP as a OpenAPI proxy, sometimes the downstream server doesn't respect 100% the json schema.
  • If the downstream server has output validation, then validating the output again is redundant.

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

@antoniomdk antoniomdk force-pushed the skip-validate-output-flag branch from 65c9d54 to 1637b70 Compare July 24, 2025 00:52
@antoniomdk antoniomdk requested review from a team and felixweinberger July 24, 2025 00:52
Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @antoniomdk thank you for this contribution! And apologies for the time it took to get back to you on this one.

I understand the motivation here that you want to be able to rely on downstream validation when it's available and skip validation here.

However I believe this would allow some hard to discover bugs when turning validation off. If the SDK provides structured output as an option, it should also ensure that it is indeed conforming to it regardless of what might be happening downstream.

I believe the computational cost is negligible compared to the safety we have of being internally confident that the output is valid as defined by the schema.

I'm therefore going to close this PR, but if you have additional motivation or examples where this is unreasonably costly, keen to understand your use case!

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.

2 participants