Class: GrowwMcp::Tools::CancelOrder

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

Class Method Summary collapse

Class Method Details

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



201
202
203
204
205
206
207
# File 'lib/groww_mcp/tools/order_tools.rb', line 201

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