Module: ActionMCP::Client::Prompts
- Included in:
- Base
- Defined in:
- lib/action_mcp/client/prompts.rb
Instance Method Summary collapse
-
#get_prompt(name, arguments = {}) ⇒ String
Get a specific prompt with arguments.
-
#list_prompts(params = {}) ⇒ String
List all available prompts from the server.
Instance Method Details
#get_prompt(name, arguments = {}) ⇒ String
Get a specific prompt with arguments
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/action_mcp/client/prompts.rb', line 31 def get_prompt(name, arguments = {}) request_id = SecureRandom.uuid_v7 # Send request send_jsonrpc_request("prompts/get", params: { name: name, arguments: arguments }, id: request_id) # Return request ID for tracking the request request_id end |
#list_prompts(params = {}) ⇒ String
List all available prompts from the server
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/action_mcp/client/prompts.rb', line 11 def list_prompts(params = {}) request_id = SecureRandom.uuid_v7 # Send request with pagination parameters if provided request_params = {} request_params[:cursor] = params[:cursor] if params[:cursor] request_params[:limit] = params[:limit] if params[:limit] send_jsonrpc_request("prompts/list", params: request_params.empty? ? nil : request_params, id: request_id) # Return request ID for tracking the request request_id end |