Skip to main content
Glama
virtualsms-io

VirtualSMS MCP Server

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
NameRequiredDescriptionDefault
order_idYesOrder ID to cancel

Implementation Reference

  • 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),
          },
        ],
      };
    }
  • 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.',
  • 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;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/virtualsms-io/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server