Skip to content

Commit f805f3a

Browse files
committed
chore(kyleosophy): sometimes the right abstraction is no abstraction
1 parent e4e7ecc commit f805f3a

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

mcp/tools/tools_registry.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,6 @@ Can be either "start" or "stop".`)),
186186
},
187187
}
188188

189-
// ToolAdder interface for adding tools to a server
190-
type ToolAdder interface {
191-
AddTool(tool mcp.Tool, handler server.ToolHandlerFunc)
192-
}
193-
194-
// Ensure that MCPServer implements ToolAdder
195-
var _ ToolAdder = (*server.MCPServer)(nil)
196-
197189
// ToolDeps contains all dependencies needed by tool handlers
198190
type ToolDeps struct {
199191
Client *codersdk.Client
@@ -231,9 +223,9 @@ func (r ToolRegistry) WithOnlyAllowed(allowed ...string) ToolRegistry {
231223

232224
// Register registers all tools in the registry with the given tool adder
233225
// and dependencies.
234-
func (r ToolRegistry) Register(ta ToolAdder, deps ToolDeps) {
226+
func (r ToolRegistry) Register(srv *server.MCPServer, deps ToolDeps) {
235227
for _, entry := range r {
236-
ta.AddTool(entry.Tool, entry.MakeHandler(deps))
228+
srv.AddTool(entry.Tool, entry.MakeHandler(deps))
237229
}
238230
}
239231

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy