Title: progress_token is 0 on first tool-call and the return is taken mistakenly by sheffler · Pull Request #176 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: progress_token is 0 on first tool-call and the return is taken mistakenly by sheffler · Pull Request #176 · modelcontextprotocol/python-sdk
X Title: progress_token is 0 on first tool-call and the return is taken mistakenly by sheffler · Pull Request #176 · modelcontextprotocol/python-sdk
Description: 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 [x ] 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 [x ] I have read the MCP Documentation [ x] 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 See console output of request sent on first call of tool. The value of progressToken in the _meta is 0. Thus it is present.
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/176
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:6d6dbbbe-f471-8a0d-0b04-2bf54efb1230 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E656:32AC14:A598E44:DEF0798:6A5EAE83 |
| html-safe-nonce | 18544e976ac7b69dc003363f0b6af7273e5545fbf973c0e378aab143d203d49e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjU2OjMyQUMxNDpBNTk4RTQ0OkRFRjA3OTg6NkE1RUFFODMiLCJ2aXNpdG9yX2lkIjoiNjI3ODY3Nzg1OTg5ODY2NjYyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c25c75cf6e347d1b285f6f92243d4ab9bf52528dd9ad7fe052a06e9fa071d2ca |
| hovercard-subject-tag | pull_request:2301253898 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/176/files |
| twitter:image | https://avatars.githubusercontent.com/u/93730?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/93730?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7129250e6854dcc7bfa46fc877bb154b96762b31e3fa82fdf0697c71f08bb32c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3084c198d559e243975a7a7f61d0b80bcea2a724 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width