Title: [v1.x] fix: reject trailing newline in tool-name validation by maxisbey · Pull Request #3086 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: [v1.x] fix: reject trailing newline in tool-name validation by maxisbey · Pull Request #3086 · modelcontextprotocol/python-sdk
X Title: [v1.x] fix: reject trailing newline in tool-name validation by maxisbey · Pull Request #3086 · modelcontextprotocol/python-sdk
Description: Backport of #3076 to v1.x. TOOL_NAME_REGEX is $-anchored and checked with re.match; in Python, $ also matches just before a single trailing newline, so a tool name like "name\n" validated cleanly with no SEP-986 warning. Switch the check to re.fullmatch, mirroring the fix merged to main. Credit to @Otis0408 for finding and fixing the original issue (#3084, #3076). Note: v1.x has no uri_template.py (that module is v2-only), so only the tool-name half of #3076 applies here. AI Disclaimer
Open Graph Description: Backport of #3076 to v1.x. TOOL_NAME_REGEX is $-anchored and checked with re.match; in Python, $ also matches just before a single trailing newline, so a tool name like "name\n" validated...
X Description: Backport of #3076 to v1.x. TOOL_NAME_REGEX is $-anchored and checked with re.match; in Python, $ also matches just before a single trailing newline, so a tool name like "name\n" v...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3086
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:75358fdb-0804-54df-2efa-f1d9233545d5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E42A:792D5:2DFA7F:3F7148:6A57C9AD |
| html-safe-nonce | 47507e89e863881fccac460a7b6148ae397eda478dd14ab34a8f11320086c6ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDJBOjc5MkQ1OjJERkE3RjozRjcxNDg6NkE1N0M5QUQiLCJ2aXNpdG9yX2lkIjoiNTE4NTE5NjU3NjY1OTE5NjMzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 48cca1647146d5fe707437cb66667f7d6ef57b4b3ea252cc318a76418be9d708 |
| hovercard-subject-tag | pull_request:4029524497 |
| 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/3086/files |
| twitter:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/224885523?s=400&v=4 |
| og:image:alt | Backport of #3076 to v1.x. TOOL_NAME_REGEX is $-anchored and checked with re.match; in Python, $ also matches just before a single trailing newline, so a tool name like "name\n" validated... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5bf9f84655de1d0e9aa064cd3b2bc9703556c68ae53b94e21b872b7e9f1f7cc1 |
| 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 | f76ee5bea8be15c2aede06f855f5c4c808f6eaf5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width