Handler returns a tool handler by calling HandlerFunc with the given dependencies. Panics if HandlerFunc is nil - all tools should have handlers.
(deps any)
| 98 | // Handler returns a tool handler by calling HandlerFunc with the given dependencies. |
| 99 | // Panics if HandlerFunc is nil - all tools should have handlers. |
| 100 | func (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. |
no outgoing calls