Skip to main content
Glama
Emenowicz

Hybris MCP Server

by Emenowicz

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
NameRequiredDescriptionDefault
userIdYesUser 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'],
      },
    },
  • 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;
  • 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[];
    }
  • 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`
      );
    }

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