Skip to main content
Glama

execute_groovy

Run Groovy scripts in SAP Commerce Cloud (Hybris) to automate tasks, query data, or perform system administration through the Hybris scripting console.

Instructions

Execute a Groovy script in the Hybris scripting console

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesGroovy script to execute

Implementation Reference

  • The primary handler function that executes the provided Groovy script by posting it to the Hybris HAC scripting console endpoint.
    async executeGroovyScript(script: string): Promise<{ output: string; result: unknown }> { const formData = new URLSearchParams({ script, scriptType: 'groovy', }); return this.hacRequest<{ output: string; result: unknown }>( `${this.hacPrefix}/console/scripting/execute`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: formData, } ); }
  • src/index.ts:147-160 (registration)
    Tool registration in the MCP server's tools list, defining the name, description, and input schema for execute_groovy.
    { name: 'execute_groovy', description: 'Execute a Groovy script in the Hybris scripting console', inputSchema: { type: 'object', properties: { script: { type: 'string', description: 'Groovy script to execute', }, }, required: ['script'], }, },
  • Dispatch logic in the main CallToolRequestSchema handler that routes the tool call to the HybrisClient method.
    case 'execute_groovy': result = await hybrisClient.executeGroovyScript(args?.script as string); break;
  • Input schema definition for the execute_groovy tool, specifying the required 'script' parameter.
    inputSchema: { type: 'object', properties: { script: { type: 'string', description: 'Groovy script to execute', }, }, required: ['script'], },

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