magento_read
Read files from a Magento codebase with support for line ranges and method extraction. Use in batch calls to read multiple files efficiently.
Instructions
Read a file from the Magento codebase. Use in magento_batch to read multiple files in a single MCP call (e.g., grep finds 5 files → read all 5 in one batch). Supports line ranges and method extraction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to MAGENTO_ROOT. Example: "vendor/acme/module-sales/Model/OrderService.php" | |
| endLine | No | Stop reading at this line number (inclusive). Default: end of file. Use with startLine for large files. | |
| startLine | No | Start reading from this line number (1-based). Default: 1 (beginning of file). | |
| methodName | No | Extract only this method from the file (uses brace-counting). Returns the complete method body with line numbers. Much more token-efficient than reading the whole file. Example: "execute" |