sys-store-config-base-url-list
Retrieve and display all base URL configurations for Magento 2 stores to manage site access points and verify correct storefront URLs across development environments.
Instructions
List all base URLs for Magento 2 stores
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format | table |
Implementation Reference
- src/index.ts:1258-1282 (handler)Handler function that executes the `magerun2 sys:store:config:base-url:list` command based on the provided format (table, json, csv), processes the result using executeMagerun2Command, and returns formatted content or an error response.async ({ format = "table" }) => { const command = `magerun2 sys:store:config:base-url: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" ? `Base URL list (${format} format):\n\n${JSON.stringify(result.data, null, 2)}` : `Base URL list (${format} format):\n\n${result.data}`; return { content: [{ type: "text", text: responseText }] }; }
- src/index.ts:1249-1257 (schema)Tool metadata including title, description, and inputSchema defining the optional 'format' parameter with enum values table/json/csv defaulting to table.{ title: "Store Config Base URL List", description: "List all base URLs for Magento 2 stores", inputSchema: { format: z.enum(["table", "json", "csv"]) .default("table") .describe("Output format") } },
- src/index.ts:1247-1283 (registration)Registration of the tool using server.registerTool, including the tool name, schema/metadata, and inline handler function.server.registerTool( "sys-store-config-base-url-list", { title: "Store Config Base URL List", description: "List all base URLs for Magento 2 stores", inputSchema: { format: z.enum(["table", "json", "csv"]) .default("table") .describe("Output format") } }, async ({ format = "table" }) => { const command = `magerun2 sys:store:config:base-url: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" ? `Base URL list (${format} format):\n\n${JSON.stringify(result.data, null, 2)}` : `Base URL list (${format} format):\n\n${result.data}`; return { content: [{ type: "text", text: responseText }] }; } );