Skip to main content
Glama
elgentos

Magento 2 Development MCP Server

by elgentos

Setup Upgrade

setup-upgrade

Update Magento 2 database schema and data to apply system changes and maintain database integrity during development.

Instructions

Run Magento 2 setup upgrade to update database schema and data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keepGeneratedNoKeep generated files during upgrade

Implementation Reference

  • The handler function executes the 'magerun2 setup:upgrade' command, optionally appending '--keep-generated' if specified, calls executeMagerun2Command, and returns formatted success or error content.
    async ({ keepGenerated }) => {
      let command = `magerun2 setup:upgrade`;
    
      if (keepGenerated) {
        command += ` --keep-generated`;
      }
    
      const result = await executeMagerun2Command(command);
    
      if (!result.success) {
        return {
          content: [{
            type: "text",
            text: result.error
          }],
          isError: true
        };
      }
    
      return {
        content: [{
          type: "text",
          text: `Setup upgrade completed:\n\n${result.data}`
        }]
      };
    }
  • Input schema defining optional 'keepGenerated' boolean parameter for keeping generated files.
    inputSchema: {
      keepGenerated: z.boolean()
        .optional()
        .describe("Keep generated files during upgrade")
    }
  • src/index.ts:982-1019 (registration)
    Registration of the 'setup-upgrade' tool with server.registerTool, specifying name, title, description, input schema, and inline handler function.
    server.registerTool(
      "setup-upgrade",
      {
        title: "Setup Upgrade",
        description: "Run Magento 2 setup upgrade to update database schema and data",
        inputSchema: {
          keepGenerated: z.boolean()
            .optional()
            .describe("Keep generated files during upgrade")
        }
      },
      async ({ keepGenerated }) => {
        let command = `magerun2 setup:upgrade`;
    
        if (keepGenerated) {
          command += ` --keep-generated`;
        }
    
        const result = await executeMagerun2Command(command);
    
        if (!result.success) {
          return {
            content: [{
              type: "text",
              text: result.error
            }],
            isError: true
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `Setup upgrade completed:\n\n${result.data}`
          }]
        };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the action ('run') and outcome ('update database schema and data'), but lacks critical behavioral details: it doesn't specify if this is a destructive operation (likely yes for schema changes), permission requirements, execution time, error handling, or impact on site availability. For a database upgrade tool with zero annotation coverage, this is a significant gap in transparency.

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 core action and purpose without unnecessary words. Every part ('Run Magento 2 setup upgrade to update database schema and data') directly contributes to understanding the tool's function, 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 a database upgrade tool (potentially high-risk), no annotations, no output schema, and minimal behavioral disclosure, the description is incomplete. It should cover more about execution context, safety, and outcomes to compensate for the lack of structured data. The current description is adequate only for basic purpose understanding but insufficient for safe or informed usage.

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 one parameter ('keepGenerated') fully documented in the schema. The description adds no parameter-specific information beyond what the schema provides. According to rules, with high schema coverage (>80%), the baseline is 3 even with no param info in the description, which applies here.

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 verb ('run') and resource ('Magento 2 setup upgrade') with specific purpose ('to update database schema and data'). It distinguishes from siblings like 'setup-db-status' or 'db-query' by focusing on upgrade execution rather than status checks or queries. However, it doesn't explicitly differentiate from all setup-related tools like 'setup-di-compile' or 'setup-static-content-deploy' beyond the database focus.

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 (e.g., after code changes), timing considerations (e.g., during deployments), or exclusions (e.g., not for minor config updates). The description implies usage for database updates but lacks explicit context for selection among siblings like 'setup-db-status' for checking status first.

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