cancel_order
Cancel pending SMS verification orders to request refunds when no messages have been received, useful for slow services or trying different numbers.
Instructions
Cancel an order and request a refund. Only works if no SMS has been received yet. Use this if the service is taking too long or you want to try a different number.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID to cancel |
Implementation Reference
- src/tools.ts:511-524 (handler)The handler function handleCancelOrder executes the tool logic by calling the client's cancelOrder method.
export async function handleCancelOrder( client: VirtualSMSClient, args: z.infer<typeof CancelOrderInput> ) { const result = await client.cancelOrder(args.order_id); return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2), }, ], }; } - src/tools.ts:21-23 (schema)Zod schema definition for the input arguments of cancel_order.
export const CancelOrderInput = z.object({ order_id: z.string().describe('Order ID to cancel'), }); - src/tools.ts:211-216 (registration)Tool registration definition for cancel_order.
name: 'cancel_order', title: 'Cancel Order', description: 'Cancel an order and request a refund. ' + 'Only works if no SMS has been received yet. ' + 'Use this if the service is taking too long or you want to try a different number.', - src/client.ts:162-166 (helper)The underlying API call implementation in the VirtualSMSClient class.
async cancelOrder(orderId: string): Promise<CancelResult> { this.requireApiKey(); const res = await this.http.post(`/api/v1/customer/cancel/${orderId}`); return res.data as CancelResult; }