Compile an MQL5 file
compileBuild MQL5 source files via MetaEditor CLI to get structured errors and warnings, plus the .ex5 path when successful.
Instructions
Compiles a .mq5/.mqh/.mqproj file via MetaEditor's CLI and returns structured errors/warnings parsed from the compile log, plus the resulting .ex5 path on success. Success requires both zero parsed errors AND a freshly-written .ex5 (the process exit code is not trustworthy and is ignored).
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": {
"path": "<path>"
},
"name": "compile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | e.g. "Experts/Advisors/MyEA.mq5" | |
| timeoutMs | No | ||
| includePath | No |