Skip to main content
Glama

format_mql

Destructive

Formats MQL source files using clang-format while protecting MQL-specific syntax. Reports changes by default; set write=true to apply formatting.

Instructions

Format an MQL file with clang-format (MQL literals such as D'…' and input group lines are protected).

Default is a dry run reporting whether the file would change; pass write=true to apply. Replaces format_check.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleNoclang-format style string; defaults to an MQL-friendly LLVM-based profile.
writeNofalse = report/diff only (default); true = overwrite the file in its original encoding.
sourceYesAbsolute Windows path to the .mq4/.mq5/.mqh source file.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.5.0
    • addedInput schema / properties / source / description
      Added value: +"Absolute Windows path to the .mq4/.mq5/.mqh source file."
    • addedInput schema / properties / style / description
      Added value: +"clang-format style string; defaults to an MQL-friendly LLVM-based profile."
    • addedInput schema / properties / write / description
      Added value: +"false = report/diff only (default); true = overwrite the file in its original encoding."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "format_mqlDictOutput",
      +  "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?

Even though destructiveHint=true is already set, the description adds genuinely new behavioral context: the operation is a dry run by default, only becomes destructive when write=true, and protects MQL-specific constructs. This directly clarifies the destructive annotation rather than merely restating it.

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?

Three short sentences deliver purpose, protection behavior, invocation mode, and legacy status without redundancy. The critical dry-run/write behavior is placed immediately after the purpose line, and every clause earns its place.

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?

With an output schema present and 100% parameter coverage, the description covers everything needed to call the tool correctly: what it formats, what it protects, how the destructive flag works, and what it replaces. No critical caller-facing detail is missing.

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 a baseline of 3 applies; the description does add meaning by explaining that write=true applies changes and clarifying the default dry-run behavior. But it conflicts with the schema's write default of true and with the parameter description's claim that false is the default, which introduces ambiguity for an agent parsing both sources.

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?

The description opens with a specific verb plus resource: 'Format an MQL file with clang-format' and adds the key distinguishing detail that MQL literals and `input group` lines are protected. It also states it replaces format_check, giving agents an explicit lineage and differentiating it from that sibling.

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 dry-run default and `write=true` switch are explicit instructions for how to invoke the tool safely, and 'Replaces format_check' gives a clear alternative/context signal. However, it does not spell out when to choose this over nearby lint/compile/syntax siblings or list exclusions, so it stops short of a 5.

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