bos_order_refund
Refund an order by providing its ID, amount, and reason.
Instructions
Process a refund for an order
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | ||
| amount | No | ||
| reason | No |
Implementation Reference
- src/tools/bos.ts:204-207 (handler)The handler function that processes a refund by extracting order_id from args and POSTing remaining data to /mcp/orders/{order_id}/refund via the API client.
handler: async (args, client) => { const { order_id, ...data } = args; return client.post(`/mcp/orders/${order_id}/refund`, data); }, - src/tools/bos.ts:199-203 (schema)Input schema for bos_order_refund: order_id (required string), amount (optional number), reason (optional string).
schema: { order_id: { type: 'string' }, amount: { type: 'number', optional: true }, reason: { type: 'string', optional: true }, }, - src/tools/bos.ts:196-209 (registration)The tool definition object with name 'bos_order_refund', registered as part of the orderTools array in src/tools/bos.ts, which is then exported and collected into allTools in src/index.ts.
{ name: 'bos_order_refund', description: 'Process a refund for an order', schema: { order_id: { type: 'string' }, amount: { type: 'number', optional: true }, reason: { type: 'string', optional: true }, }, handler: async (args, client) => { const { order_id, ...data } = args; return client.post(`/mcp/orders/${order_id}/refund`, data); }, }, ]; - src/index.ts:27-46 (registration)The allTools array in src/index.ts aggregates all tool arrays including orderTools (via spread), which contains bos_order_refund. Each tool is then registered with the MCP server via server.tool() in the loop at lines 55-72.
const allTools: McpTool[] = [ ...healthTools, ...moduleTools, ...routeTools, ...cacheTools, ...systemTools, ...productTools, ...orderTools, ...cartTools, ...customerTools, ...inventoryTools, ...voucherTools, ...loyaltyTools, ...storeTools, ...checkoutTools, ...promotionTools, ...engagementTools, ...erpTools, ...smartTools, ]; - src/tools/index.ts:4-9 (helper)The McpTool interface definition used by all tool definitions, including bos_order_refund. It specifies the structure: name, description, schema, and handler.
export interface McpTool { name: string; description: string; schema: Record<string, any>; handler: (args: any, client: BosApiClient) => Promise<any>; }