Module: ActionMCP::Client::Elicitation
- Included in:
- Base
- Defined in:
- lib/action_mcp/client/elicitation.rb
Overview
Handles elicitation requests from servers
Instance Method Summary collapse
-
#process_elicitation_request(id, params) ⇒ Object
Process elicitation request from server.
-
#send_elicitation_response(id, action:, content: nil) ⇒ Object
Send elicitation response.
Instance Method Details
#process_elicitation_request(id, params) ⇒ Object
Process elicitation request from server
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/action_mcp/client/elicitation.rb', line 10 def process_elicitation_request(id, params) params["message"] params["requestedSchema"] # In a real implementation, this would prompt the user # For now, we'll just return a decline response # Actual implementations should override this method send_jsonrpc_response(id, result: { action: "decline" }) end |
#send_elicitation_response(id, action:, content: nil) ⇒ Object
Send elicitation response
26 27 28 29 30 31 |
# File 'lib/action_mcp/client/elicitation.rb', line 26 def send_elicitation_response(id, action:, content: nil) result = { action: action } result[:content] = content if action == "accept" && content send_jsonrpc_response(id, result: result) end |