progress_token is 0 on first tool-call and the return is taken mistakenly#176
Merged
dsp-ant merged 3 commits intomodelcontextprotocol:mainfrom Jan 30, 2025
Merged
Conversation
Contributor
Author
|
Simple test server for exercising progress reporting. |
Contributor
Author
|
This looks better than my suggestion. Thank you. |
How does the client receive progress notifications from the server? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The first time a tool is called the progress_token is present, but its value is 0. The way the conditional
is written the value of 0 is False and (not 0) is True. What we want is to return if the value is not present (None).
Motivation and Context
I had a small server that sent progress notifications and I noticed that on the first call to the tool, the
progress notifications were not sent. On subsequent tool calls they were.
How Has This Been Tested?
Yes. I have tested with a small server and observed the progress notifications in Inspector.
Breaking Changes
No
Types of changes
Checklist
Additional context
See console output of request sent on first call of tool. The value of progressToken in the _meta is 0. Thus
it is present.