fix: missing "properties" property in empty schema #598
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR fixes a behaviour difference between the TS and Python SDK in regards to how MCP tools with no parameters are handled.
How Has This Been Tested?
Yes, this has been both unit-tested and e2e tested in a real world scenario.
Breaking Changes
No breaking changes here.
Types of changes
Checklist
Additional context
This issue was found while fixing a downstream related issue in the LangChain.js package, see this comment here (unfold) for details: https://github.com/langchain-ai/langchainjs/pull/8222/files/d3999743ef9beff7a667601ba10aa4d04a245027#diff-837f7946011257a2651ecd961d544e72da8192f0fa3c2a04b6a17a2024ed31bb
We found out that TS and Python MCP SDKs were handling the case of MCP tools with no parameters differently. In some cases, the PY server even enforce the
additionalProperties: false
attribute in the JSON schema, however due to how this is handled in the TS SDK, I could not also add it here without the risk of breaking stuff as the empty schema is used as a fallback.