-
Notifications
You must be signed in to change notification settings - Fork 24
Tools filtering #62
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
Tools filtering #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could probably give this file a bit more love but this should be good enough for a first iteration of tool filtering
Something I haven't discussed with anyone but want to do is: EDIT1: We might need another approach if we want to show just the enabled tools count in the servers tab table or the count in the Tools tab when viewing a server |
Hey @cmrigney, I didn't have time to look at Daniel's PR. Could you? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition! lgtm, just left a couple optional suggestions.
- name: "other_tool" | ||
description: "Another tool" | ||
` | ||
writeFile(t, filepath.Join(home, ".docker/mcp/catalogs/docker-mcp.yaml"), []byte(catalogContent)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: I think if I run these tests in VSCode instead of make test
(in a container), it will break my local setup right? In that case, it might be a good idea to read the existing file and add a t.Cleanup
that re-writes it back to the original.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, totally missed that. Nice! 👍
What I did
Tool filtering
Add new commands:
docker mcp tools enable <toolName>
anddocker mcp tools disable <toolName>
. They auto-discover the first matching server using the catalog. Also they accept a--server
flag. It helps with duplicate tool names where the auto-discover might fail to find the server the user wants.The enabled tools are stored in a
tools.yaml
file which contains all the enabled tools grouped by server. Example file:read as:
The gateway reads and respects this file. When launching the gateway, the existing
--tools
option (which accepts the tools names) takes precedence over thetools.yaml
file. This works the same way as the--servers
option and theregistry.yaml
.Nice to haves:
tools.yaml
if all of the server's tools are enabled--server
flagRelated issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did