Title: feat: add support for meta parameter in client paginated list queries by smohite04 · Pull Request #906 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: feat: add support for meta parameter in client paginated list queries by smohite04 · Pull Request #906 · modelcontextprotocol/java-sdk
X Title: feat: add support for meta parameter in client paginated list queries by smohite04 · Pull Request #906 · modelcontextprotocol/java-sdk
Description: Add support for meta parameter in listTools method. Motivation and Context McpSchema.PaginatedRequest now has a meta field (added in #344), but the client API methods don't expose it. As a result, servers which can accept the meta parameter in list tools cannot be used with java client. The Python SDK already supports passing _meta in tools/list requests: python async def list_tools(self, *, cursor=None, meta=None) -> ListToolsResult This change aligns the Java SDK with the Python SDK and the MCP spec which allows _meta in PaginatedRequestParams. How Has This Been Tested? Unit tests: McpAsyncClientTests.testListToolsWithCursorAndMeta() and testSyncListToolsWithCursorAndMeta() - verify _meta is correctly serialized in the JSON-RPC request Integration test: AbstractMcpSyncClientTests.testListToolsWithMeta() - verified against the real server-everything MCP server via HttpClientStreamableHttpSyncClientTests (Docker/Testcontainers). Ran per recommendations Unit tests (McpAsyncClientTests): Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.467 s testListToolsWithCursorAndMeta -- Time elapsed: 0.031 s ✅ testSyncListToolsWithCursorAndMeta -- Time elapsed: 0.006 s ✅ testListToolsWithEmptyCursor -- Time elapsed: 0.360 s ✅ (+ 4 existing tests passing) BUILD SUCCESS Integration test (HttpClientStreamableHttpSyncClientTests against real server-everything via Docker): Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.59 s testListToolsWithMeta -- Time elapsed: 0.445 s ✅ BUILD SUCCESS Breaking Changes None. New overloaded methods added; existing listTools(String cursor) behavior unchanged. 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 Closes #907
Open Graph Description: Add support for meta parameter in listTools method. Motivation and Context McpSchema.PaginatedRequest now has a meta field (added in #344), but the client API methods don't expose it. As a res...
X Description: Add support for meta parameter in listTools method. Motivation and Context McpSchema.PaginatedRequest now has a meta field (added in #344), but the client API methods don't expose it. As a...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/pull/906
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0373a0b3-dac6-9044-8ca3-65a619642571 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DF0E:12D89D:7945A9E:A381434:6A5E24BE |
| html-safe-nonce | a60e7d70a0ed81d450ac1f4316cae151ca581eb7f6d9c424e61a2b6a5d2159b9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjBFOjEyRDg5RDo3OTQ1QTlFOkEzODE0MzQ6NkE1RTI0QkUiLCJ2aXNpdG9yX2lkIjoiMTY0MzQ3MTU4Njk0NjA2NTU5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6a8d24e57053de6b9b5631d9c330d2b1d26e90afc7c07a30e3682ff3a9b05966 |
| hovercard-subject-tag | pull_request:3498866114 |
| 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/java-sdk/pull/906/files |
| twitter:image | https://avatars.githubusercontent.com/u/71900919?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/71900919?s=400&v=4 |
| og:image:alt | Add support for meta parameter in listTools method. Motivation and Context McpSchema.PaginatedRequest now has a meta field (added in #344), but the client API methods don't expose it. As a res... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e5010f4d2748a3cbef86e1580413ff14701bd99f255268dfb4a2857c77e2cc7c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-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 | 7d23604c4a8ce0274b4c71bb2adbe6e1c9d5904f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width