Skip to main content
Glama
Emenowicz

Hybris MCP Server

by Emenowicz

flexible_search

Execute FlexibleSearch queries to retrieve data from SAP Commerce Cloud (Hybris) databases using custom search syntax for product management and system administration.

Instructions

Execute a FlexibleSearch query against the Hybris database. Use FlexibleSearch syntax.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesFlexibleSearch query (e.g., "SELECT {pk}, {code} FROM {Product}")
maxCountNoMaximum number of results (default: 100)

Implementation Reference

  • src/index.ts:194-211 (registration)
    Registers the 'flexible_search' tool in the MCP tools list, including name, description, and input schema definition.
    {
      name: 'flexible_search',
      description: 'Execute a FlexibleSearch query against the Hybris database. Use FlexibleSearch syntax.',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'FlexibleSearch query (e.g., "SELECT {pk}, {code} FROM {Product}")',
          },
          maxCount: {
            type: 'number',
            description: 'Maximum number of results (default: 100)',
          },
        },
        required: ['query'],
      },
    },
  • MCP server tool call handler for 'flexible_search': validates input arguments and delegates to HybrisClient.executeFlexibleSearch.
    case 'flexible_search':
      result = await hybrisClient.executeFlexibleSearch(
        validateString(args, 'query', true),
        validateNumber(args, 'maxCount', { min: 1, max: 10000 })
      );
      break;
  • Core implementation of flexible search: sends POST request to Hybris HAC FlexibleSearch endpoint with query and maxCount, returns FlexibleSearchResult.
    async executeFlexibleSearch(query: string, maxCount = 100): Promise<FlexibleSearchResult> {
      const formData = new URLSearchParams({
        flexibleSearchQuery: query,
        maxCount: maxCount.toString(),
      });
    
      return this.hacRequest<FlexibleSearchResult>(
        `${this.hacPrefix}/console/flexsearch/execute`,
        {
          method: 'POST',
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
          },
          body: formData,
        }
      );
    }
  • Type definition for the output of flexible_search: array of result objects and total count.
    export interface FlexibleSearchResult {
      results: Record<string, unknown>[];
      count: number;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool executes a query but doesn't mention whether it's read-only or mutating, what permissions are required, potential side effects, rate limits, or error handling. This is inadequate for a database query tool with zero annotation coverage.

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 extremely concise with two sentences that directly state the tool's function and syntax requirement. Every word earns its place, and it's front-loaded with the core purpose, making it efficient and well-structured.

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

Completeness2/5

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

Given the complexity of a database query tool with no annotations and no output schema, the description is incomplete. It lacks information on return values, error conditions, behavioral traits, and differentiation from siblings. For a tool that could have significant implications (e.g., performance, data access), this is insufficient.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents both parameters. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain FlexibleSearch syntax further or provide examples beyond the schema's example). Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('Execute a FlexibleSearch query') and target resource ('against the Hybris database'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'search_products' or 'execute_groovy' that might also query the database, missing full sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'Use FlexibleSearch syntax' as a usage note but doesn't specify contexts, prerequisites, or exclusions compared to siblings like 'search_products' or 'get_product', leaving the agent without clear selection criteria.

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

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