get_orders
Retrieve order details for a specific user by providing their user ID or email address.
Instructions
Get orders for a specific user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User ID or email |
Implementation Reference
- src/index.ts:162-175 (registration)Registration of the 'get_orders' MCP tool including its input schema definition.{ name: 'get_orders', description: 'Get orders for a specific user', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID or email', }, }, required: ['userId'], }, },
- src/index.ts:395-399 (handler)Handler for the 'get_orders' tool: validates the userId argument and delegates to HybrisClient.getOrders method.case 'get_orders': result = await hybrisClient.getOrders( validateString(args, 'userId', true) ); break;
- src/hybris-client.ts:48-58 (schema)TypeScript interfaces defining the structure of Order and OrderEntry objects used in getOrders response.export interface Order { code: string; status: string; created: string; totalPrice: { value: number; currencyIso: string; formattedValue: string; }; entries: OrderEntry[]; }
- src/hybris-client.ts:437-441 (helper)Helper method in HybrisClient that performs the actual REST API call to retrieve orders for a user via OCC endpoint.async getOrders(userId: string): Promise<{ orders: Order[] }> { return this.request<{ orders: Order[] }>( `/rest/v2/${encodeURIComponent(this.config.baseSiteId!)}/users/${encodeURIComponent(userId)}/orders?fields=FULL` ); }