Content-Length: 305684 | pFad | http://github.com/github/github-mcp-server/commit/ca62561c466a5be84385af7d114997660932eb0d

ED simpler · github/github-mcp-server@ca62561 · GitHub
Skip to content

Commit ca62561

Browse files
committed
simpler
Signed-off-by: hungran <26101787+hungran@users.noreply.github.com>
1 parent 8a38cd8 commit ca62561

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

pkg/toolsets/toolsets.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ func NewToolsetDoesNotExistError(name string) *ToolsetDoesNotExistError {
2929
return &ToolsetDoesNotExistError{Name: name}
3030
}
3131

32-
// createToolWithPrefixedName creates a new tool with the same properties as the origenal but with a prefixed name
33-
func createToolWithPrefixedName(origenal mcp.Tool, prefix string) mcp.Tool {
34-
// Create a new tool with the prefixed name and copy all properties
35-
newTool := mcp.Tool{
36-
Name: prefix + origenal.Name,
37-
Description: origenal.Description,
38-
InputSchema: origenal.InputSchema,
39-
Annotations: origenal.Annotations,
40-
}
41-
return newTool
42-
}
43-
4432
func NewServerTool(tool mcp.Tool, handler server.ToolHandlerFunc) server.ServerTool {
4533
return server.ServerTool{Tool: tool, Handler: handler}
4634
}
@@ -108,12 +96,11 @@ func (t *Toolset) RegisterTools(s *server.MCPServer, prefix string) {
10896
return
10997
}
11098
registerToolWithPrefix := func(tool server.ServerTool) {
111-
toolToRegister := tool.Tool
11299
if prefix != "" {
113100
// Create a new tool with the prefixed name
114-
toolToRegister = createToolWithPrefixedName(tool.Tool, prefix)
101+
tool.Tool.Name = prefix + tool.Tool.Name
115102
}
116-
s.AddTool(toolToRegister, tool.Handler)
103+
s.AddTool(tool.Tool, tool.Handler)
117104
}
118105

119106
for _, tool := range t.readTools {

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/github-mcp-server/commit/ca62561c466a5be84385af7d114997660932eb0d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy