Skip to main content
Glama

import_impex

Import data into SAP Commerce Cloud using ImpEx format to manage products, orders, and configurations.

Instructions

Import data using ImpEx format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
impexContentYesImpEx content to import

Implementation Reference

  • The importImpex handler, implemented in HybrisClient, which executes a Groovy script on the Hybris server to import data using the ImportService.
      async importImpex(impexContent: string): Promise<ImpexResult> {
        // Use Groovy script for ImpEx import with ImportService
        const escapedContent = this.escapeGroovyString(impexContent);
    
        const script = `
    import de.hybris.platform.servicelayer.impex.ImportService
    import de.hybris.platform.servicelayer.impex.ImportConfig
    import de.hybris.platform.servicelayer.impex.impl.StreamBasedImpExResource
    
    try {
        def impexContent = "${escapedContent}"
        def importService = spring.getBean("importService")
    
        def config = new ImportConfig()
        def resource = new StreamBasedImpExResource(
            new ByteArrayInputStream(impexContent.getBytes("UTF-8")),
            "UTF-8"
        )
        config.setScript(resource)
        config.setEnableCodeExecution(true)
    
        def importResult = importService.importData(config)
    
        if (importResult.hasUnresolvedLines()) {
            println "WARNING: Import completed with unresolved lines"
            importResult.unresolvedLines.allLines.each { line ->
                println "  Unresolved: " + line
            }
        }
    
        if (importResult.isError()) {
            println "ERROR: Import failed"
            if (importResult.unresolvedLines?.allLines) {
                importResult.unresolvedLines.allLines.each { line ->
                    println "  Error: " + line
                }
            }
            return "ERROR"
        }
    
        println "SUCCESS: ImpEx import completed"
        return "SUCCESS"
    } catch (Exception e) {
        println "ERROR: " + e.getMessage()
        e.printStackTrace()
        return "ERROR: " + e.getMessage()
    }
    `;
        const result = await this.executeGroovyScript(script, true); // commit=true for imports
        const output = result.output || '';
        const execResult = String(result.result || '');
        const success = output.includes('SUCCESS:') || execResult === 'SUCCESS';
        const errors: string[] = [];
    
        // Extract unresolved lines as errors
        const unresolvedMatch = output.match(/Unresolved: (.+)/g);
        if (unresolvedMatch) {
          errors.push(...unresolvedMatch);
        }
    
        const errorMatch = output.match(/ERROR: (.+)/);
        if (errorMatch) {
          errors.push(errorMatch[1]);
        }
    
        return {
          success,
          message: output || execResult,
          errors: errors.length > 0 ? errors : undefined,
        };
      }
  • src/index.ts:430-434 (registration)
    Registration and invocation of the import_impex tool in the main MCP server request handler.
    case 'import_impex':
      result = await hybrisClient.importImpex(
        validateString(args, 'impexContent', 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 imports data but doesn't describe effects (e.g., whether it overwrites existing data, requires permissions, has side effects like triggering updates, or handles errors). This is inadequate for a mutation 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.

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a simple tool, though it could be more front-loaded with key details.

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 data import tool with no annotations and no output schema, the description is incomplete. It lacks information on behavioral traits, usage context, and expected outcomes, making it insufficient for safe and effective use by an AI agent.

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%, with the single parameter 'impexContent' documented in the schema as 'ImpEx content to import'. The description adds no additional meaning beyond this, so it meets the baseline score of 3 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.

Purpose3/5

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

The description 'Import data using ImpEx format' states the action (import) and the format (ImpEx), but it's vague about what data is being imported or into what system. It doesn't distinguish from sibling tools like 'export_impex' beyond the direction of operation.

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, context for ImpEx imports, or refer to sibling tools like 'export_impex' for related operations.

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