Skip to main content
Glama

explain_code

Look up the plain-language meaning of an MQL5 trade server return code or runtime error by number or constant name to diagnose trading and script issues.

Instructions

Explain an MQL5 trade server return code (MqlTradeResult.retcode, e.g. 10016) or runtime error (GetLastError(), e.g. 4014) by number or constant name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the input domain and the two accepted forms (number or constant name), which implies a read-only lookup with no side effects, but it never explicitly states that this is a non-mutating lookup nor describes the shape of the explanation returned. Adequate but not rich.

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?

A single sentence that front-loads the action and the resource, then packs the accepted input forms and examples into the parenthetical. No filler or redundancy.

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

Completeness4/5

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

For a one-parameter, no-output-schema lookup tool this is nearly complete: it defines the input domain, both accepted forms, and examples. The only omission is any statement about what the returned explanation contains, which the absence of an output schema leaves unstated.

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

Parameters4/5

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

Schema coverage is 0%: the single 'code' parameter is only typed as integer-or-string with no description. The description compensates by explaining that the value is a return code or runtime error, that it can be given as a number (10016, 4014) or a constant name, which directly clarifies the anyOf integer/string union in the schema.

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?

States a specific verb ('Explain') and a precisely bounded resource (MQL5 trade server return codes from MqlTradeResult.retcode and runtime errors from GetLastError()), with concrete example values. This is clearly distinguishable from the sibling tools search_reference and get_signature, which retrieve documentation or signatures rather than interpreting a code.

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

Usage Guidelines3/5

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

The description implies the usage context well by naming the two sources of codes (MqlTradeResult.retcode, GetLastError()), so an agent can infer it should call this when it holds such a code. However, it gives no explicit when-to-use versus alternatives and no exclusions, so the guidance remains implied rather than stated.

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

Deploy Server

Other Tools