sys-store-list
Retrieve a complete list of Magento 2 stores, websites, and store views in table, JSON, or CSV format for development and system management purposes.
Instructions
List all Magento 2 stores, websites, and store views
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format | table |
Implementation Reference
- src/index.ts:1172-1196 (handler)The handler function for the 'sys-store-list' tool. It runs the 'magerun2 sys:store:list' command with the specified format (table, json, csv), handles errors, and returns formatted output.async ({ format = "table" }) => { const command = `magerun2 sys:store:list --format=${format}`; const result = await executeMagerun2Command(command, format === "json"); if (!result.success) { return { content: [{ type: "text", text: result.error }], isError: true }; } const responseText = format === "json" ? `Store list (${format} format):\n\n${JSON.stringify(result.data, null, 2)}` : `Store list (${format} format):\n\n${result.data}`; return { content: [{ type: "text", text: responseText }] }; }
- src/index.ts:1166-1170 (schema)Input schema for the tool defining the 'format' parameter as an enum with values 'table', 'json', 'csv', defaulting to 'table'.inputSchema: { format: z.enum(["table", "json", "csv"]) .default("table") .describe("Output format") }
- src/index.ts:1161-1197 (registration)Registration of the 'sys-store-list' tool via server.registerTool, including title, description, input schema, and the handler function.server.registerTool( "sys-store-list", { title: "Store List", description: "List all Magento 2 stores, websites, and store views", inputSchema: { format: z.enum(["table", "json", "csv"]) .default("table") .describe("Output format") } }, async ({ format = "table" }) => { const command = `magerun2 sys:store:list --format=${format}`; const result = await executeMagerun2Command(command, format === "json"); if (!result.success) { return { content: [{ type: "text", text: result.error }], isError: true }; } const responseText = format === "json" ? `Store list (${format} format):\n\n${JSON.stringify(result.data, null, 2)}` : `Store list (${format} format):\n\n${result.data}`; return { content: [{ type: "text", text: responseText }] }; } );