Code validation

MQL5 syntax checker MCP for MetaEditor

Pineify's mql5-syntax-checker is a read-only MCP tool that checks either one complete MQL5 source file or a supplied multi-file project with MetaEditor. It returns normalized error locations without editing the code or running a trading strategy.

MCP tool name
mql5-syntax-checker

Example prompt

Use Pineify to check this standalone MQL5 Expert Advisor with MetaEditor and explain each returned error.

Direct answer

What mql5-syntax-checker does

Use the standalone mode when the entire program is in one source string. Send only code. The gateway checks it as Scripts/Main.mq5, so code cannot be combined with entry or files in the same request.

Use project mode when the entry file depends on local includes or other source files. Send entry as a relative .mq5 path and include that exact path, plus every required project file, in files. The tool does not read a local workspace or discover missing dependencies for you.

The result separates compile findings from service failures. hasError reports whether MetaEditor returned errors, while isTimeout and isSystemError show that no conclusive check was completed.

Contract

What the agent sends and receives

Inputs

  • Standalone mode: code contains the complete non-empty MQL5 source and cannot exceed 512 KiB in UTF-8.
  • Project mode: entry is the relative path of the entry .mq5 file and must also appear in files.
  • Project mode: files contains unique relative paths and source content for every required file, with up to 50 files and 2 MiB of total UTF-8 content.
  • Choose one mode per call. Send code alone, or send entry and files together.

Structured output

  • hasError states whether MetaEditor returned one or more compiler errors.
  • errors contains message, row, column, and an optional matched file path for each diagnostic.
  • isTimeout states that the downstream validation request exceeded its time limit.
  • isSystemError states that the checker could not produce a valid result because of a service or response failure.

Capabilities

Where this MCP tool fits

Standalone MQL5 checks

Submit one complete script, indicator, or Expert Advisor through the code field for a focused MetaEditor compile check.

Multi-file project checks

Submit an entry path with the project files needed by that entry, including relative .mq5 and .mqh paths used by the build.

Normalized diagnostics

Receive each compiler error with its message, row, column, and a source file path when the reported path can be matched safely.

Read-only agent routing

Let an MCP client call the checker without changing source files, placing trades, or modifying a MetaTrader account.

Agent workflow

A bounded call from question to review

  1. 1

    Choose the input mode

    Use code for one self-contained source file. Use entry with files when the entry depends on other project files.

  2. 2

    Supply complete source

    For a project, include the entry path in files and add every required include or source file with a unique relative path.

  3. 3

    Run the MetaEditor check

    The MCP tool sends the bounded source set to the MetaEditor validation service and returns structured status fields.

  4. 4

    Review and retry

    Fix diagnostics by file, row, and column. Retry after changes, but treat timeouts and system errors as inconclusive results.

Prompt examples

Questions an agent can route to this tool

"Use Pineify to check this standalone MQL5 Expert Advisor with MetaEditor and explain each returned error."
"Use Pineify to compile-check this multi-file MQL5 project. Experts/Main.mq5 is the entry, and I will provide every .mq5 and .mqh file it needs."
"Run the MQL5 syntax checker on these project files, then group the diagnostics by file and suggest the smallest source fixes."

Operator notes

How I review the result

I send only code for a quick check of one self-contained MQL5 file. Mixing code with entry or files is rejected before MetaEditor runs.

I use project mode when the entry imports local files. I make entry match one file path exactly and include every required .mq5 and .mqh source in files.

I treat isTimeout or isSystemError as an inconclusive check, never as a successful compile. When hasError is true, I fix the earliest useful diagnostic and run the checker again because later errors may be consequences of the first one.

Boundaries to keep in the prompt

  • This is a compile check, not a backtest, strategy tester run, optimization, or proof that the trading logic is correct.
  • Standalone mode cannot resolve project files that are not present in the submitted code. Use entry and files for a project with local dependencies.
  • Project mode accepts at most 50 files. Each file is limited to 512 KiB in UTF-8, and all submitted file content together is limited to 2 MiB.
  • The checker only returns compiler errors in its normalized errors array. It does not return MetaEditor warnings through this MCP contract.
  • A diagnostic file path is optional because MetaEditor output is only attached to a submitted path when the match is unambiguous.
  • The tool validates code through a remote service. Check your code-sharing policy before sending proprietary MQL5 source.

Pineify MCP is an information and code-validation tool, not investment advice. It does not promise returns, place trades, or modify a portfolio. Review timestamps, source fields, code diagnostics, and risk assumptions before acting.

FAQ

MQL5 syntax checker MCP for MetaEditor questions

Add mql5-syntax-checker to your AI workflow

Connect one remote Pineify MCP endpoint, then let your compatible AI client discover this tool with the rest of the read-only catalog.

Open MCP setup