-
Notifications
You must be signed in to change notification settings - Fork 162
Add --no-tools to catalog show and server ls #270
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
base: main
Are you sure you want to change the base?
Conversation
To address issue where too much data was being printed when showing an entire catalog, introduce a option to specify --no-tools to exclude tools from the response. Additionally, add a `docker mcp catalog-next server ls` command so that we can get individual server information from a catalog that does include the tools.
Using --format json or yaml would return the entire contents of all the catalogs. Instead, return the data that is returned for human readable output.
11a4ed8 to
3e01128
Compare
cmrigney
left a comment
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.
lgtm. Left a couple suggestions but we can follow up later.
| return outputServers(catalog.Ref, catalog.Title, servers, format) | ||
| } | ||
|
|
||
| func parseFilters(filters []string) ([]serverFilter, error) { |
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.
thought (follow up later): I wonder if we can reuse some of the code we have in workingset/server.go.
| if noTools { | ||
| catalog = filterCatalogTools(catalog) | ||
| } |
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 (non-blocking): I would personally find it more readable if we edit in-place to nil the values out instead of making a copy:
| if noTools { | |
| catalog = filterCatalogTools(catalog) | |
| } | |
| if noTools { | |
| for i := range catalog.Servers { | |
| catalog.Servers[i].Tools = nil | |
| if catalog.Servers[i].Snapshot != nil { | |
| catalog.Servers[i].Snapshot.Server.Tools = nil | |
| } | |
| } | |
| } |
What I did
docker mcp catalog-next server lswith filtering options on the server name so that we can get the details of a single server, including all of it's toolsdocker mcp catalog-next showbecause we were returning too much data that would exceed a 1MB limit for node processes to for data over stdiodocker mcp catalog-next ls --format json/yamlreturn list data instead of all the data for all the catalogs, which would also exceed the 1MB limitRelated issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did