config-store-set
Set store-specific configuration values in Magento 2 to customize settings for individual store views or websites.
Instructions
Set store-specific Magento 2 configuration values
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Configuration path to set | |
| storeId | No | Store ID (optional) | |
| value | Yes | Value to set |
Implementation Reference
- src/index.ts:904-929 (handler)The handler function for the 'config-store-set' tool. It builds a magerun2 command to set store-specific configuration and executes it, returning success or error response.async ({ path, value, storeId }) => { let command = `magerun2 config:store:set "${path}" "${value}"`; if (storeId) { command += ` --store-id="${storeId}"`; } const result = await executeMagerun2Command(command); if (!result.success) { return { content: [{ type: "text", text: result.error }], isError: true }; } return { content: [{ type: "text", text: `Store configuration set successfully:\n\n${result.data}` }] }; }
- src/index.ts:894-902 (schema)Input schema using Zod for validating the tool's parameters: path (string), value (string), storeId (optional string).inputSchema: { path: z.string() .describe("Configuration path to set"), value: z.string() .describe("Value to set"), storeId: z.string() .optional() .describe("Store ID (optional)") }
- src/index.ts:889-930 (registration)Registration of the 'config-store-set' tool with server.registerTool, including name, metadata (title, description), input schema, and inline handler function.server.registerTool( "config-store-set", { title: "Config Store Set", description: "Set store-specific Magento 2 configuration values", inputSchema: { path: z.string() .describe("Configuration path to set"), value: z.string() .describe("Value to set"), storeId: z.string() .optional() .describe("Store ID (optional)") } }, async ({ path, value, storeId }) => { let command = `magerun2 config:store:set "${path}" "${value}"`; if (storeId) { command += ` --store-id="${storeId}"`; } const result = await executeMagerun2Command(command); if (!result.success) { return { content: [{ type: "text", text: result.error }], isError: true }; } return { content: [{ type: "text", text: `Store configuration set successfully:\n\n${result.data}` }] }; } );