Skip to main content
Glama
Emenowicz

Hybris MCP Server

by Emenowicz

export_impex

Export data from SAP Commerce Cloud to ImpEx format using FlexibleSearch queries for data migration, backup, or system integration.

Instructions

Export data to ImpEx format using a FlexibleSearch query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
flexQueryYesFlexibleSearch query for data to export

Implementation Reference

  • The core handler function exportImpex in HybrisClient that generates ImpEx export using a FlexibleSearch query executed via Groovy script in HAC.
      async exportImpex(flexQuery: string): Promise<string> {
        // Use Groovy script for ImpEx export
        const escapedQuery = this.escapeGroovyString(flexQuery);
    
        const script = `
    try {
        def flexibleSearchService = spring.getBean("flexibleSearchService")
        def query = "${escapedQuery}"
        def searchResult = flexibleSearchService.search(query)
    
        if (searchResult.result.isEmpty()) {
            println "No results found for query"
            return "# No results found"
        }
    
        // Build ImpEx header from first item
        def firstItem = searchResult.result[0]
        def itemType = firstItem.itemtype  // Use lowercase 'itemtype' property
    
        def sb = new StringBuilder()
        sb.append("# Exported from FlexibleSearch: ").append(query).append("\\n")
        sb.append("# Result count: ").append(searchResult.totalCount).append("\\n\\n")
    
        // Simple export format
        sb.append("INSERT_UPDATE ").append(itemType).append(";pk[unique=true]\\n")
        searchResult.result.each { item ->
            sb.append(";").append(item.PK.toString()).append("\\n")
        }
    
        println "SUCCESS: Exported " + searchResult.result.size() + " items"
        return sb.toString()
    } catch (Exception e) {
        println "ERROR: " + e.getMessage()
        e.printStackTrace()
        return "# Error: " + e.getMessage()
    }
    `;
        const result = await this.executeGroovyScript(script);
        const execResult = String(result.result || '');
    
        // If result looks like ImpEx content, return it
        if (execResult.includes('INSERT_UPDATE') || execResult.includes('# ')) {
          return execResult;
        }
    
        return result.output || execResult || '# Export failed';
      }
  • Input schema for the export_impex tool, defining the required 'flexQuery' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        flexQuery: {
          type: 'string',
          description: 'FlexibleSearch query for data to export',
        },
      },
      required: ['flexQuery'],
    },
  • src/index.ts:245-257 (registration)
    Registration of the 'export_impex' tool in the MCP tools list.
      name: 'export_impex',
      description: 'Export data to ImpEx format using a FlexibleSearch query',
      inputSchema: {
        type: 'object',
        properties: {
          flexQuery: {
            type: 'string',
            description: 'FlexibleSearch query for data to export',
          },
        },
        required: ['flexQuery'],
      },
    },
  • Dispatcher switch case that handles MCP tool calls for 'export_impex' by invoking the HybrisClient.exportImpex method with validated arguments.
    case 'export_impex':
      result = await hybrisClient.exportImpex(
        validateString(args, 'flexQuery', true)
      );
      break;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool exports data but doesn't describe what happens during export (e.g., file generation, download process, side effects), permissions required, rate limits, or error handling. This leaves significant gaps for a tool that likely involves data processing and output generation.

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 front-loads the key information ('Export data to ImpEx format') without unnecessary words. Every part of the sentence contributes to understanding the tool's purpose and method, making it appropriately sized 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 an export operation with no annotations and no output schema, the description is incomplete. It doesn't explain what the export produces (e.g., file format, location, structure), potential impacts, or how to handle the output. For a tool that likely generates data output, this lack of detail is a significant gap.

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?

The description adds minimal value beyond the input schema, which has 100% coverage. It mentions 'using a FlexibleSearch query', which aligns with the 'flexQuery' parameter description in the schema. However, it doesn't provide additional context like query format examples, export scope, or output details, so it meets the baseline for high schema coverage.

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 ('Export data') and target format ('to ImpEx format'), with the method specified ('using a FlexibleSearch query'). It distinguishes from sibling tools like 'import_impex' by focusing on export rather than import, but doesn't explicitly differentiate from other data retrieval tools like 'flexible_search' or 'search_products'.

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. It doesn't mention prerequisites, when not to use it, or compare it to siblings like 'flexible_search' (which might return data directly) or 'import_impex' (for the reverse operation). The description implies usage for exporting data with FlexibleSearch, but lacks explicit context.

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