Skip to main content
Glama

get_orders

Retrieve order information for a specific user in SAP Commerce Cloud by providing their user ID or email address.

Instructions

Get orders for a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUser ID or email

Implementation Reference

  • Core implementation of getOrders method in HybrisClient that fetches the user's orders via the OCC REST API endpoint.
    async getOrders(userId: string): Promise<{ orders: Order[] }> { return this.request<{ orders: Order[] }>( `/rest/v2/${this.config.baseSiteId}/users/${userId}/orders?fields=FULL` ); }
  • src/index.ts:97-110 (registration)
    Registration of the 'get_orders' tool in the MCP tools array, defining name, description, and 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'], }, },
  • MCP tool call handler switch case that delegates 'get_orders' execution to hybrisClient.getOrders.
    case 'get_orders': result = await hybrisClient.getOrders(args?.userId as string); break;
  • TypeScript interface defining the Order structure used in the output of getOrders.
    export interface Order { code: string; status: string; created: string; totalPrice: { value: number; currencyIso: string; formattedValue: string; }; entries: OrderEntry[]; }
  • Input schema for the 'get_orders' tool validating the userId parameter.
    inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'User ID or email', }, }, required: ['userId'], },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Emenowicz/hybris-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server