get_order
Retrieve detailed order information from ShipBob's fulfillment API by providing the order ID, enabling efficient order management and tracking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | The ID of the order to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"orderId": {
"description": "The ID of the order to retrieve",
"type": "string"
}
},
"required": [
"orderId"
],
"type": "object"
}
Implementation Reference
- src/tools/order-tools.js:39-54 (handler)Handler function for the 'get_order' tool. Fetches the specific order by ID using the ShipBob client and returns formatted JSON response or error message.handler: async ({ orderId }) => { try { const order = await shipbobClient.getOrder(orderId); return { content: [{ type: "text", text: JSON.stringify(order, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving order: ${error.message}` }], isError: true }; } }
- src/tools/order-tools.js:36-38 (schema)Zod input schema for the 'get_order' tool, defining the required 'orderId' parameter.schema: { orderId: z.string().describe("The ID of the order to retrieve") },
- src/server.js:51-51 (registration)Registers the orderTools array (containing 'get_order' tool) with the MCP server via registerTools function.registerTools(orderTools);
- src/api-client.js:76-78 (helper)ShipBobClient helper method 'getOrder' that performs the actual API GET request to retrieve order details by ID.async getOrder(id) { return this.request('GET', `/orders/${id}`); }