Skip to main content
Glama

compile

Compile MQL source files and receive structured diagnostics. Identifies errors with file, line, column, and code, confirming whether a fresh binary was produced.

Instructions

Compile one MQL source with MetaEditor and return structured diagnostics.

ok is true only when the log has a Result: line with 0 errors AND (unless syntax_only) a fresh .ex5/.ex4 was produced (binary_fresh). Fix every entry in errors (file, line, col, code, message) and call again; warnings do not block deployment. Takes 1-30 s. To also copy the binary into Experts/ use compile_and_deploy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesAbsolute Windows path to the .mq4/.mq5/.mqh source file.
includeNoMQL root folder (parent of Include/) if different from the active terminal's.
log_fileNoExplicit path for the compile log; defaults to .mt5tmp/<stem>.compile.log next to the source.
syntax_onlyNotrue = MetaEditor /s syntax check only: faster, produces no binary.
timeout_secNoGive up after this many seconds.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.5.0
    • addedInput schema / properties / include / description
      Added value: +"MQL root folder (parent of Include/) if different from the active terminal's."
    • addedInput schema / properties / log_file / description
      Added value: +"Explicit path for the compile log; defaults to .mt5tmp/<stem>.compile.log next to the source."
    • addedInput schema / properties / source / description
      Added value: +"Absolute Windows path to the .mq4/.mq5/.mqh source file."
    • addedInput schema / properties / syntax_only
      Added value: +{
      +  "default": false,
      +  "description": "true = MetaEditor /s syntax check only: faster, produces no binary.",
      +  "title": "Syntax Only",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / timeout_sec / description
      Added value: +"Give up after this many seconds."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "compileDictOutput",
      +  "type": "object"
      +}
  2. First observedv0.4.1

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description explains the exact success condition (`ok` requires a `Result:` line with 0 errors, plus a fresh binary unless syntax_only), the `binary_fresh` concept, expected duration (1–30 s), and that warnings do not block deployment. This is substantive behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact, front-loaded with the core purpose, and every sentence earns its place: success semantics, retry guidance, timing, and the sibling alternative. No filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich output schema and fully documented parameters, the description covers all essential operational context: success criteria, error handling, timing, binary freshness, and the deployment alternative. The agent has everything needed to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds a little semantic context around `syntax_only` and `timeout_sec` via the duration note, but does not meaningfully extend the schema's own parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opening sentence names a specific action ('Compile one MQL source') and the tool context ('with MetaEditor'), and the final sentence distinguishes the sibling compile_and_deploy. The purpose is immediately clear and non-tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear guidance on when to call this tool versus compile_and_deploy, and instructs the agent to fix errors and retry. It does not explicitly mention the sibling syntax_check tool, though the syntax_only parameter partially covers that use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.