MCPcopy
hub / github.com/github/github-mcp-server / Handler

Method Handler

pkg/inventory/server_tool.go:100–105  ·  view source on GitHub ↗

Handler returns a tool handler by calling HandlerFunc with the given dependencies. Panics if HandlerFunc is nil - all tools should have handlers.

(deps any)

Source from the content-addressed store, hash-verified

98// Handler returns a tool handler by calling HandlerFunc with the given dependencies.
99// Panics if HandlerFunc is nil - all tools should have handlers.
100func (st *ServerTool) Handler(deps any) mcp.ToolHandler {
101 if st.HandlerFunc == nil {
102 panic("HandlerFunc is nil for tool: " + st.Tool.Name)
103 }
104 return st.HandlerFunc(deps)
105}
106
107// RegisterFunc registers the tool with the server using the provided dependencies.
108// Icons are automatically applied from the toolset metadata if not already set.

Calls

no outgoing calls