Skip to content

Conversation

@SheldonNunes
Copy link
Contributor

Motivation and Context

This PR fixes a bug in the ruby-sdk where if a tool provided has zero arguments it will throw an error. In order to resolve this the following line needed updating to handle nil case:
args = arguments&.transform_keys(&:to_sym) || {}

Example of tools not requiring args e.g. Listing a set of resources available / configuration.

How Has This Been Tested?

Tested in local application and added unit test for this case

Breaking Changes

No breaking change

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

@SheldonNunes SheldonNunes force-pushed the sheldon.fix-tools-with-no-args branch from c4687bb to 7473722 Compare July 23, 2025 01:42
@SheldonNunes SheldonNunes requested a review from atesgoral July 23, 2025 01:43
@koic koic merged commit a84b56c into modelcontextprotocol:main Jul 23, 2025
5 checks passed
@atesgoral atesgoral mentioned this pull request Sep 14, 2025
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.

3 participants