fix: Support list tools pagination in tools change notification handler #306
+49
−15
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
Tools change notification handler is meant to send the updated list of tools to all consumers (clients) who have signed up for tools change notifications. In the current implementation in java-sdk, this would only return the first page of tools to the consumer. This PR introduces a fix to ensure that the tools change notification handler deals with the pagination for list tools and returns a list of all tools across pages back to the consumer.
How Has This Been Tested?
Wrote a unit test that broke down list tools result across pages. Tested with the code before and after the change introduced in the PR. The old code (without the PR change) fails to return the complete list of tools. The new code (with the change) successfully returns all the tools across all pages.
Breaking Changes
None
Types of changes
Checklist