get_customer
Retrieve customer details from ShipStation using a customer ID to access shipping information and manage order data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customerId | Yes | Customer ID to retrieve |
Implementation Reference
- src/tools/customer-tools.js:38-50 (handler)The async handler function for the 'get_customer' tool. It retrieves the customer using shipStationClient.getCustomer(customerId), returns JSON-formatted response or error message.handler: async ({ customerId }) => { try { const customer = await shipStationClient.getCustomer(customerId); return { content: [{ type: "text", text: JSON.stringify(customer, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } }
- src/tools/customer-tools.js:35-37 (schema)Zod schema defining the required input parameter 'customerId' as a number.schema: { customerId: z.number().describe("Customer ID to retrieve") },
- src/server.js:174-191 (registration)The registration loop that spreads customerTools (containing 'get_customer') and registers each tool with the MCP server using server.tool().[ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); });
- src/api-client.js:161-163 (helper)ShipStationClient method getCustomer that makes the API request to retrieve a specific customer, called by the tool handler.async getCustomer(customerId) { return this.request('GET', `/customers/${customerId}`); }