-
Notifications
You must be signed in to change notification settings - Fork 40
fix: three bug fixes for MCP tools and background embedding generation #219
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import ( | |
| "encoding/hex" | ||
| "errors" | ||
| "fmt" | ||
| "strings" | ||
| "time" | ||
|
|
||
| restv0 "github.com/agentregistry-dev/agentregistry/internal/registry/api/handlers/v0" | ||
|
|
@@ -369,10 +370,14 @@ func addDeploymentTools(server *mcp.Server, registry service.RegistryService) { | |
| } | ||
| outIdx := 0 | ||
| for _, d := range deployments { | ||
| if args.ResourceType != "" && d.ResourceType != args.ResourceType { | ||
| if args.ResourceType != "" && !strings.EqualFold(d.ResourceType, args.ResourceType) { | ||
| continue | ||
| } | ||
| resp.Deployments[outIdx] = *d | ||
| dep := *d | ||
| if dep.Config == nil { | ||
| dep.Config = map[string]string{} | ||
| } | ||
| resp.Deployments[outIdx] = dep | ||
|
Comment on lines
+376
to
+380
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to avoid a so in config := labels
if config == nil {
config = make(map[string]string)
}
d := {
...
config: config
...
}for what it's worth, our db listing code already does something similar to this, so we'd essentially be matching its behavior in the k8s listing if d.Config == nil {
d.Config = make(map[string]string)
} |
||
| outIdx++ | ||
| } | ||
| resp.Deployments = resp.Deployments[:outIdx] | ||
|
|
@@ -392,7 +397,11 @@ func addDeploymentTools(server *mcp.Server, registry service.RegistryService) { | |
| if err != nil { | ||
| return nil, models.Deployment{}, err | ||
| } | ||
| return nil, *deployment, nil | ||
| dep := *deployment | ||
| if dep.Config == nil { | ||
| dep.Config = map[string]string{} | ||
| } | ||
| return nil, dep, nil | ||
| }) | ||
|
|
||
| // Deploy server | ||
|
|
||
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.
nit: i'm personally a bit iffy on this. it makes sense, but as far as I could tell this is the only place in the code we'd support case-insensitive