-
Notifications
You must be signed in to change notification settings - Fork 235
IMcpServerBuilder
should support chaining of multiple WithTools
calls
#27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This also is a problem if you want to use a combination of I've hit this as a problem when trying to work around #69 and #68, as I wanted to fallback to using custom implemented tool handlers but doing so breaks all the tools exposed via |
How would you expect this to work in combination with specifying tools via attributes? Locally I have a change I'm testing that overhauls how these tools are registered, to address this issue, but it will still fail (throws) if you both set an explicit handler and specify tools via attributes. |
I would imagine it working like how the routing ending in aspnet works because (at least in my mind) that's how I think about the incoming messages - something to be routed to a handler. |
For example, ListTools. Are you saying you'd expect to be able to add a handler for listing tools, have it list 5 tools, but then augment the result with an entry for every attributed tool? Or are you saying you'd only expect that custom handler to be invoked if there weren't any tools? Or to be able to see what the tools are and decide which of them should be included? There are a ton of possible policies here. It's not clear to me any is more correct than another. |
You're right that there's not "correct" way to tackle this. I think the most obvious approach would be that if there wasn't a tool explicitly configured with the name of the incoming tool, then it'd fall through to the generic callback, assuming you registered one. If you were to register a tool via That would avoid a situation where you have to be very away of the order in which you add them to the pipeline. This would result in an order of Tools from |
In that world, what would ListTools do? |
It'd be a fair expectation that if you're providing a We could have an analyzer that looks for |
Originally posted by @eiriktsarpalis in PederHP/mcpdotnet#95.
Originally posted by @stephentoub in PederHP/mcpdotnet#92 (comment)
The text was updated successfully, but these errors were encountered: