(_ context.Context, req *ListPromptsRequest)
| 699 | } |
| 700 | |
| 701 | func (s *Server) listPrompts(_ context.Context, req *ListPromptsRequest) (*ListPromptsResult, error) { |
| 702 | s.mu.Lock() |
| 703 | defer s.mu.Unlock() |
| 704 | if req.Params == nil { |
| 705 | req.Params = &ListPromptsParams{} |
| 706 | } |
| 707 | return paginateList(s.prompts, s.opts.PageSize, req.Params, &ListPromptsResult{}, func(res *ListPromptsResult, prompts []*serverPrompt) { |
| 708 | res.Prompts = []*Prompt{} // avoid JSON null |
| 709 | for _, p := range prompts { |
| 710 | res.Prompts = append(res.Prompts, p.prompt) |
| 711 | } |
| 712 | }) |
| 713 | } |
| 714 | |
| 715 | func (s *Server) getPrompt(ctx context.Context, req *GetPromptRequest) (*GetPromptResult, error) { |
| 716 | s.mu.Lock() |
nothing calls this directly
no test coverage detected