(_ context.Context, req *ListToolsRequest)
| 727 | } |
| 728 | |
| 729 | func (s *Server) listTools(_ context.Context, req *ListToolsRequest) (*ListToolsResult, error) { |
| 730 | s.mu.Lock() |
| 731 | defer s.mu.Unlock() |
| 732 | if req.Params == nil { |
| 733 | req.Params = &ListToolsParams{} |
| 734 | } |
| 735 | return paginateList(s.tools, s.opts.PageSize, req.Params, &ListToolsResult{}, func(res *ListToolsResult, tools []*serverTool) { |
| 736 | res.Tools = []*Tool{} // avoid JSON null |
| 737 | for _, t := range tools { |
| 738 | res.Tools = append(res.Tools, t.tool) |
| 739 | } |
| 740 | }) |
| 741 | } |
| 742 | |
| 743 | func (s *Server) callTool(ctx context.Context, req *CallToolRequest) (*CallToolResult, error) { |
| 744 | s.mu.Lock() |
nothing calls this directly
no test coverage detected