get_magento_pattern
Retrieve Magento 2 coding patterns and examples for specific tasks, showing correct implementations and common pitfalls to avoid.
Instructions
Get the correct Magento 2 way to accomplish a task. Returns the proper pattern, code example, and what to avoid. Use this for "vibe coding" - writing Magento-compliant code naturally.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task": "<task>"
},
"name": "get_magento_pattern"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The task you want to accomplish (e.g., "read a file", "escape HTML", "validate email", "create viewmodel") |