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:9ad9acbb-ce9a-0ba4-1b60-b044007932ea |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CA5C:3A669A:7F6361:B2D786:6A5F9183 |
| html-safe-nonce | d20cfbfa15c622e54677a98e02b4500fe114b8b0f4a759b3672c6a2e566ab01a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTVDOjNBNjY5QTo3RjYzNjE6QjJENzg2OjZBNUY5MTgzIiwidmlzaXRvcl9pZCI6IjE4NDAyMjAyMDIyNTIwODcwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e7bade63b8725b1375fc35fd8b4f53487a3c1087b5d1273828e0f393c6692fd0 |
| 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 | 419b66b5f218029570caa18c30987e7dbabe4f5a6767918b33a504d02739c9c7 |
| 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 | de5b18aa36dbc0b61e03aeb111e84e90fde499b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width