get_orders
Retrieve order details for a specific user from SAP Commerce Cloud using 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/hybris-client.ts:453-457 (handler)Actual implementation of the getOrders tool logic in the Hybris client class.
async getOrders(userId: string): Promise<{ orders: Order[] }> { return this.request<{ orders: Order[] }>( `/occ/v2/${encodeURIComponent(this.config.baseSiteId!)}/users/${encodeURIComponent(userId)}/orders?fields=FULL` ); } - src/index.ts:162-175 (registration)Registration of the get_orders tool with its input schema.
{ 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:403-407 (handler)The handler case in index.ts that calls the hybrisClient for the get_orders tool.
case 'get_orders': result = await hybrisClient.getOrders( validateString(args, 'userId', true) ); break;