Class: GrowwMcp::Tools::CancelSmartOrder

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/groww_mcp/tools/smart_order_tools.rb

Class Method Summary collapse

Class Method Details

.call(server_context:, order_id:, smart_order_type:, segment: "CASH") ⇒ Object



217
218
219
220
221
222
223
# File 'lib/groww_mcp/tools/smart_order_tools.rb', line 217

def call(server_context:, order_id:, smart_order_type:, segment: "CASH")
  client = server_context[:client]
  result = client.cancel_smart_order(order_id, smart_order_type: smart_order_type, segment: segment)
  format_response(result)
rescue GrowwMcp::ApiError => e
  error_response(e)
end