RegisterPrompts registers all available prompts with the server. The context is used for feature flag evaluation. Icons are automatically applied from the toolset metadata if not already set.
(ctx context.Context, s *mcp.Server)
| 239 | // The context is used for feature flag evaluation. |
| 240 | // Icons are automatically applied from the toolset metadata if not already set. |
| 241 | func (r *Inventory) RegisterPrompts(ctx context.Context, s *mcp.Server) { |
| 242 | for _, prompt := range r.AvailablePrompts(ctx) { |
| 243 | // Make a shallow copy to avoid mutating the original |
| 244 | promptCopy := prompt.Prompt |
| 245 | // Apply icons from toolset metadata if not already set |
| 246 | if len(promptCopy.Icons) == 0 { |
| 247 | promptCopy.Icons = prompt.Toolset.Icons() |
| 248 | } |
| 249 | s.AddPrompt(&promptCopy, prompt.Handler) |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | // RegisterAll registers all available tools, resources, and prompts with the server. |
| 254 | // The context is used for feature flag evaluation. |
no test coverage detected