Skip to main content
Glama
elgentos

Magento 2 Development MCP Server

by elgentos

Cache View

cache-view

View specific cache entries in Magento 2 to inspect stored data and troubleshoot caching issues by providing the cache key.

Instructions

Inspect specific cache entries in Magento 2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesCache key to inspect
typeNoCache type (optional)

Implementation Reference

  • Handler function that runs the `magerun2 cache:view` command to inspect the specified cache entry, handling input parameters 'key' and optional 'type', executing the command via the shared executeMagerun2Command helper, and formatting the response.
        const typeArg = type ? `--type=${type}` : '';
        const command = `magerun2 cache:view ${typeArg} "${key}"`.trim();
        const result = await executeMagerun2Command(command);
    
        if (!result.success) {
          return {
            content: [{
              type: "text",
              text: result.error
            }],
            isError: result.isError
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `Cache entry for key "${key}":\n\n${result.data}`
          }]
        };
      }
    );
  • Schema definition for the cache-view tool, including title, description, and Zod input schema requiring a 'key' string and optional 'type' string.
      title: "Cache View",
      description: "Inspect specific cache entries in Magento 2",
      inputSchema: {
        key: z.string()
          .describe("Cache key to inspect"),
        type: z.string()
          .optional()
          .describe("Cache type (optional)")
      }
    },
    async ({ key, type }) => {
  • src/index.ts:341-375 (registration)
    Full registration of the 'cache-view' MCP tool using server.registerTool, including the tool name, schema, and inline handler implementation.
      "cache-view",
      {
        title: "Cache View",
        description: "Inspect specific cache entries in Magento 2",
        inputSchema: {
          key: z.string()
            .describe("Cache key to inspect"),
          type: z.string()
            .optional()
            .describe("Cache type (optional)")
        }
      },
      async ({ key, type }) => {
        const typeArg = type ? `--type=${type}` : '';
        const command = `magerun2 cache:view ${typeArg} "${key}"`.trim();
        const result = await executeMagerun2Command(command);
    
        if (!result.success) {
          return {
            content: [{
              type: "text",
              text: result.error
            }],
            isError: result.isError
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `Cache entry for key "${key}":\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 states 'inspect' which implies a read-only operation, but does not disclose behavioral traits such as whether it requires specific permissions, what format the inspection output is in, if it handles missing keys gracefully, or any rate limits. This is a significant gap for a tool with no 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.

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 cache operations in Magento 2, no annotations, and no output schema, the description is incomplete. It lacks details on what 'inspect' entails (e.g., returns entry details, metadata, or just existence), how it interacts with sibling tools, or any error handling, making it inadequate for informed tool selection.

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%, so the schema already documents both parameters (key and type). The description adds no additional meaning beyond what the schema provides, such as examples of cache keys or cache types, but since the schema is comprehensive, the baseline score of 3 is appropriate.

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 'inspect' and the resource 'specific cache entries in Magento 2', making the purpose understandable. However, it does not explicitly differentiate from sibling tools like cache-status (which might show overall cache status) or cache-flush (which modifies cache), leaving room for ambiguity in sibling distinction.

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. With siblings like cache-status (which might list cache entries) and cache-clean (which might remove entries), there is no indication of context, prerequisites, or exclusions, leaving the agent to infer usage from the name alone.

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