MCPcopy Create free account
hub / github.com/asim/reminder / AddTool

Method AddTool

api/mcp.go:110–120  ·  view source on GitHub ↗

AddTool registers a tool with the server.

(name, description string, schema InputSchema, handler ToolHandler)

Source from the content-addressed store, hash-verified

108
109// AddTool registers a tool with the server.
110func (s *Server) AddTool(name, description string, schema InputSchema, handler ToolHandler) {
111 s.mu.Lock()
112 defer s.mu.Unlock()
113
114 s.tools = append(s.tools, Tool{
115 Name: name,
116 Description: description,
117 InputSchema: schema,
118 })
119 s.handlers[name] = handler
120}
121
122// ServeHTTP handles MCP requests over Streamable HTTP.
123func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {

Callers 4

mainFunction · 0.95
TestToolsListFunction · 0.95
TestToolsCallFunction · 0.95
TestToolCallErrorFunction · 0.95

Calls

no outgoing calls

Tested by 3

TestToolsListFunction · 0.76
TestToolsCallFunction · 0.76
TestToolCallErrorFunction · 0.76