Skip to main content
Glama

cancel_order

Cancel an order in ShipBob's fulfillment system by providing the order ID and optional reason, enabling order management adjustments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderIdYesThe ID of the order to cancel
reasonNoReason for cancellation

Implementation Reference

  • The handler function for the 'cancel_order' tool. It destructures orderId and optional reason, prepares cancelData, calls shipbobClient.cancelOrder, and returns a formatted MCP response or error.
    handler: async ({ orderId, reason }) => { try { const cancelData = { reason }; const result = await shipbobClient.cancelOrder(orderId, cancelData); return { content: [{ type: "text", text: `Order cancelled successfully: ${JSON.stringify(result, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `Error cancelling order: ${error.message}` }], isError: true }; } }
  • Zod schema defining the input parameters for the cancel_order tool: orderId (required string) and reason (optional string).
    schema: { orderId: z.string().describe("The ID of the order to cancel"), reason: z.string().optional().describe("Reason for cancellation") },
  • src/server.js:51-51 (registration)
    Registers the orderTools array (which includes cancel_order) by calling registerTools, which in turn calls server.tool() for each tool.
    registerTools(orderTools);
  • ShipBobClient helper method that makes the POST request to the ShipBob API to cancel an order using the generic request method.
    async cancelOrder(id, cancelData) { return this.request('POST', `/orders/${id}/cancel`, cancelData); }

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/mattcoatsworth/shipbob-mcp-server'

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