| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
| * @return This builder instance for method chaining | ||
| * @see #addToolFilter(McpAsyncListFilter) | ||
| */ | ||
| public AsyncSpecification<S> toolFilters( |
There was a problem hiding this comment.
Not convinced about the practicality of such flexibility. It exposes the builder's internal mutable list. Perhaps a plain toolFilters(List<McpSyncListFilter<Tool>>), or deferring the method until demand appears, would be the safer?
Sorry, something went wrong.
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
| Back | FazBrowse Home | New Git URL |
Context
The SDK lacks capabilities for dynamically returning tools, resources, prompts, etc (see #578).
A full implementation in the current state (2.x, 2025-11-25) spec would be complex, as it'd need to target [sync | async] x [stateful | stateless] = 4 variants. We'd need to address the bridges between sync and async, make it coexist with current server's tool management (array list of tools, .addTool method).
We are currently focusing on the implementation of the 2026-07-28 spec, which will bring an entirely new, breaking API. It would be a perfect opportunity to bring in repositories as described in #578 .
In the meantime, we recognize users have been asking for capabilities for a long time. The majority of the asks are centered around filtering the list of tools (#997 , #525, examples in #593, #746, #608, etc). While we recognize there are other asks (dynamic tool generation, other primitives than tools), we think they'd be better addressed by a full #578 implementation. In the meantime, we decided exposing filter capabilities for tools, in this PR.
Scope
This PR is focused on tool list filtering only, while opening the door for filtering other resources if necessary. It addresses filtering in every variant mentioned above.
⚠️⚠️ The filtering only applies to tools listing. It does NOT apply to tool calling, as this can already be achieved in the tool handler. Similarly, it does NOT apply to notifications/tools/list_changed notifications, as these notifications are session-scoped, and not request-scoped. It is recommended that you DO NOT use notifications when using filters.
Closes #997
Closes #525 (with caveats, the main discussion is in #578)
Closes #593 (with caveats, the main discussion is in #578)