get_order
Retrieve specific order details from SAP Commerce Cloud using user ID and order code for tracking and management purposes.
Instructions
Get details of a specific order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User ID or email | |
| orderCode | Yes | Order code/number |
Implementation Reference
- src/hybris-client.ts:378-382 (handler)Core implementation of get_order: fetches specific order details for a user via Hybris OCC REST API.async getOrder(userId: string, orderCode: string): Promise<Order> { return this.request<Order>( `/rest/v2/${this.config.baseSiteId}/users/${userId}/orders/${orderCode}?fields=FULL` ); }
- src/index.ts:317-322 (handler)MCP tool handler: switch case that invokes HybrisClient.getOrder with tool arguments.case 'get_order': result = await hybrisClient.getOrder( args?.userId as string, args?.orderCode as string ); break;
- src/index.ts:111-128 (registration)Tool registration in the tools array, including name, description, and input schema.{ name: 'get_order', description: 'Get details of a specific order', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID or email', }, orderCode: { type: 'string', description: 'Order code/number', }, }, required: ['userId', 'orderCode'], }, },
- src/hybris-client.ts:48-58 (schema)Type definition for Order output structure.export interface Order { code: string; status: string; created: string; totalPrice: { value: number; currencyIso: string; formattedValue: string; }; entries: OrderEntry[]; }
- src/index.ts:114-127 (schema)Input schema for tool validation: requires userId and orderCode.inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID or email', }, orderCode: { type: 'string', description: 'Order code/number', }, }, required: ['userId', 'orderCode'], },