Skip to main content
Glama
elgentos

Magento 2 Development MCP Server

by elgentos

System Check

sys-check

Verify Magento 2 system requirements and configuration settings to ensure proper platform compatibility and identify potential issues before deployment.

Instructions

Check Magento 2 system requirements and configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the 'magerun2 sys:check' command using the executeMagerun2Command helper, processes the result, handles errors, and returns formatted text content.
        const command = `magerun2 sys:check`;
        const result = await executeMagerun2Command(command);
    
        if (!result.success) {
          return {
            content: [{
              type: "text",
              text: result.error
            }],
            isError: true
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `System check results:\n\n${result.data}`
          }]
        };
      }
    );
  • Input/output schema for the sys-check tool: title, description, and empty inputSchema indicating no parameters are required.
    {
      title: "System Check",
      description: "Check Magento 2 system requirements and configuration",
      inputSchema: {}
    },
  • src/index.ts:689-717 (registration)
    Registration of the sys-check tool with McpServer using server.registerTool, including name, schema, and handler function.
      "sys-check",
      {
        title: "System Check",
        description: "Check Magento 2 system requirements and configuration",
        inputSchema: {}
      },
      async () => {
        const command = `magerun2 sys:check`;
        const result = await executeMagerun2Command(command);
    
        if (!result.success) {
          return {
            content: [{
              type: "text",
              text: result.error
            }],
            isError: true
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `System check results:\n\n${result.data}`
          }]
        };
      }
    );
  • Shared utility function used by sys-check (and other tools) to safely execute magerun2 commands, handle timeouts, parse JSON output, and provide Magento-specific error messages.
     */
    async function executeMagerun2Command(command: string, parseJson: boolean = false): Promise<{
      success: true;
      data: any;
      rawOutput: string;
    } | {
      success: false;
      error: string;
      isError: true;
    }> {
      try {
        const { stdout, stderr } = await execAsync(command, {
          cwd: process.cwd(),
          timeout: 30000 // 30 second timeout
        });
    
        if (stderr && stderr.trim()) {
          console.error("magerun2 stderr:", stderr);
        }
    
        if (parseJson) {
          try {
            return { success: true, data: JSON.parse(stdout), rawOutput: stdout };
          } catch (parseError) {
            return {
              success: false,
              error: `Error parsing magerun2 JSON output: ${parseError}\n\nRaw output:\n${stdout}`,
              isError: true
            };
          }
        }
    
        return { success: true, data: stdout.trim(), rawOutput: stdout };
    
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
    
        // Check if magerun2 is not found
        if (errorMessage.includes("command not found") || errorMessage.includes("not recognized")) {
          return {
            success: false,
            error: "Error: magerun2 command not found. Please ensure n98-magerun2 is installed and available in your PATH.\n\nInstallation instructions: https://github.com/netz98/n98-magerun2",
            isError: true
          };
        }
    
        // Check if not in Magento directory
        if (errorMessage.includes("not a Magento installation") || errorMessage.includes("app/etc/env.php")) {
          return {
            success: false,
            error: "Error: Current directory does not appear to be a Magento 2 installation. Please run this command from your Magento 2 root directory.",
            isError: true
          };
        }
    
        return {
          success: false,
          error: `Error executing magerun2 command: ${errorMessage}`,
          isError: true
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool performs a 'check' (implying read-only, non-destructive behavior) but doesn't specify what the check entails (e.g., returns a report, validates against benchmarks, requires admin permissions) or any side effects. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operation.

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: 'Check Magento 2 system requirements and configuration.' It is front-loaded with the core action and resource, with zero wasted words. Every part of the sentence contributes directly to understanding the tool's function.

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?

Given the tool's complexity (simple check with no parameters) and lack of annotations/output schema, the description is minimally complete. It states what the tool does but lacks details on behavior, output format, or integration context. It's adequate for a basic tool but would benefit from more context about what the check returns or when to use it.

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 0 parameters, and schema description coverage is 100% (though trivial since there are no parameters). The description doesn't need to add parameter details, so it meets the baseline of 4 for zero-parameter tools. It appropriately focuses on the tool's purpose without unnecessary parameter explanations.

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 tool's purpose: 'Check Magento 2 system requirements and configuration' with a specific verb ('Check') and resource ('Magento 2 system requirements and configuration'). It distinguishes from most siblings (e.g., cache-*, config-*, dev-* tools) but doesn't explicitly differentiate from 'sys-info' or 'setup-db-status' which might overlap in system assessment.

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 doesn't mention prerequisites, timing (e.g., after installation or before upgrades), or compare to siblings like 'sys-info' (which might provide general system info) or 'setup-db-status' (which checks database status). Usage is implied only by the tool name and description.

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/elgentos/magento2-dev-mcp'

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