Class: ActionMCP::PromptsRegistry

Inherits:
RegistryBase show all
Defined in:
lib/action_mcp/prompts_registry.rb

Overview

Registry for managing prompts.

Class Method Summary collapse

Methods inherited from RegistryBase

clear!, find, items, non_abstract, re_register, register, size, unregister

Class Method Details

.item_klassObject



24
25
26
# File 'lib/action_mcp/prompts_registry.rb', line 24

def item_klass
  Prompt
end

.prompt_call(prompt_name, arguments) ⇒ Hash

Calls a prompt with the given name and arguments.

Parameters:

  • prompt_name (String)

    The name of the prompt to call.

  • arguments (Hash)

    The arguments to pass to the prompt.

Returns:

  • (Hash)

    A hash containing the prompt’s response.



17
18
19
20
21
22
# File 'lib/action_mcp/prompts_registry.rb', line 17

def prompt_call(prompt_name, arguments)
  prompt = find(prompt_name)
  prompt = prompt.new(arguments)

  prompt.call
end