Skip to main content
Glama

fxapis — MetaTrader 5

Margin or profit

calculate
Read-onlyIdempotent

The margin an order would need, or its profit between two prices, as the broker computes it; opens nothing. The account must be online. Example: {"account_id": "", "kind": "margin", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "price": "1.08450"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYesmargin: required to open. profit: result between price and close_price.
sideYesbuy or sell.
priceYesEntry price. An absolute price (e.g. "1.08450"), not a distance in pips or points.
symbolYesThe symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r".
volumeYesOrder size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot.
account_idYesThe fxapis account id (a UUID) from list_accounts — not the MT5 login number.
close_priceNoExit price. Required when kind is profit. An absolute price (e.g. "1.08450"), not a distance in pips or points.
response_formatNoconcise (default): what a next step needs. detailed: every field the API returns.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYes
valueYesIn the account's currency.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is covered; the description adds meaningful context on top — that nothing is opened and that the account must be online — which is a real state requirement an agent must satisfy. Return semantics are left to the output schema, and no rate-limit or failure-mode detail is offered.

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?

One compact sentence covering purpose, scope and precondition, followed by a single example — front-loaded and free of filler.

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, return values need no explanation; the description supplies purpose, the account-state precondition, the non-mutating guarantee, and a worked example against a 6-required-parameter schema that is itself fully documented. Nothing an agent needs before calling is missing.

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 description coverage is 100%, so the baseline is 3; the description goes beyond it by supplying a fully-formed example payload that shows the string-encoded numeric conventions and the margin-vs-profit field combination. It does not clarify the close_price requirement for kind=profit in its own words, leaving that entirely to 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 computation ('the margin an order would need, or its profit between two prices, as the broker computes it') and immediately differentiates itself from the order-placing siblings with 'opens nothing'. An agent can distinguish it from place_market_order/place_pending_order without opening any schema.

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?

Gives a concrete precondition ('The account must be online') and implies the preview-vs-execute distinction via 'opens nothing', which routes an agent away from the order-placement siblings. It does not, however, name an alternative tool or state exclusions explicitly.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources