Skip to content

fix: missing "properties" property in empty schema #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sinedied
Copy link

@sinedied sinedied commented Jun 9, 2025

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

  • 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

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.

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