Skip to main content
Glama

get_categories

Retrieve the category tree structure from a product catalog to organize and navigate product hierarchies in SAP Commerce Cloud.

Instructions

Get the category tree from the product catalog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the getCategories method that fetches the category tree from the Hybris OCC API.
    async getCategories(): Promise<Category[]> {
      interface CatalogResponse {
        catalogs: Array<{
          id: string;
          catalogVersions: Array<{
            id: string;
            categories: Category[];
          }>;
        }>;
      }
    
      const result = await this.request<CatalogResponse>(
        `/occ/v2/${encodeURIComponent(this.config.baseSiteId!)}/catalogs`
      );
    
      // Extract categories from the first catalog version matching our config
      const catalog = result.catalogs?.find(c => c.id === this.config.catalogId);
      if (!catalog) return [];
    
      const version = catalog.catalogVersions?.find(v => v.id === this.config.catalogVersion);
      return version?.categories || [];
    }
  • The handler logic in index.ts that routes the "get_categories" tool call to the hybrisClient.getCategories method.
    case 'get_categories':
      result = await hybrisClient.getCategories();
      break;
  • src/index.ts:141-147 (registration)
    Tool definition for "get_categories" registered in the tools array.
      name: 'get_categories',
      description: 'Get the category tree from the product catalog',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions retrieving a 'category tree' but doesn't specify format, depth, permissions needed, or whether it's cached/live data. For a read operation with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any fluff or redundancy. It's appropriately sized for a simple, parameterless tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless read tool with no output schema, the description is minimally adequate but incomplete. It doesn't explain what a 'category tree' entails (structure, fields) or behavioral aspects like performance or data freshness, leaving the agent to guess about the return format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (empty schema). The description appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's purpose without unnecessary detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('category tree from the product catalog'), making the purpose understandable. However, it doesn't distinguish this tool from its sibling 'get_category' (singular vs. plural), which could cause confusion about when to use each.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_category' or 'search_products'. The description only states what it does, not when it's appropriate or what context it serves.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mcieunic/hybris-mcp-main'

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