Skip to main content
Glama

ForexDemo.com

Yen Carry Trade Calculator

calculate_yen_carry
Read-onlyIdempotent

What a carry trade earns or pays in swap over a holding period, its yearly carry yield, how far the price can move against it before the swap is used up, and what a sharp unwind like 2024 would cost. Same calculation as the Yen Carry Trade Calculator page at https://forexdemo.com/yen-carry-trade-calculator.html. Every input is optional unless marked required; left-out inputs use the page's defaults, which are listed in the reply.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "price": "<price>",
      "long": "<long>",
      "short": "<short>"
    },
    "name": "calculate_yen_carry"
  }
}

Input Schema

NameRequiredDescriptionDefault
longYesSwap long (for buys), exactly as the platform shows it, in swapUnit. A charge has a minus sign, such as -9.17.
pairNoCurrency pair. The yen pairs are the classic carry trades; the other pairs work too.USD/JPY
rateNoOnly needed when the account currency is not in the pair: the price of the market pair that converts it (for example the GBP/USD price for EUR/GBP in a USD account). Required when the account currency is not in the pair.
sideNobuy (long) or sell (short).buy
sizeNoTrade size, counted in sizeUnit.
priceYesPair price now.
shortYesSwap short (for sells), exactly as the platform shows it, in swapUnit.
balanceNoOptional account balance.
holdingNoHolding period, in holdingUnit.
openDayNoDay the trade is opened.Monday
currencyNoThe currency the trading account is held in.USD
sizeUnitNolots (100,000 units each) or units.lots
swapUnitNoThe unit the platform shows the swap in: points (MetaTrader), pips, percent a year, or money per standard lot per night.points
precisionNoOnly for points: fractional when prices have 5 decimals (3 for yen pairs), whole when they have 4 (2 for yen pairs).fractional
tripleDayNoThe night that counts three days of interest.Wednesday
yearBasisNoOnly for percent: the number of days in the broker's interest year.365
holdingUnitNoUnit of the holding period.months
amountCurrencyNoOnly for money: the currency the swap amounts are in.quote

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent and non-destructive behavior, so the bar is lower. The description still adds real behavioral context beyond them: omitted inputs fall back to the page's defaults, and those defaults are echoed in the reply, which tells the agent how to interpret partial-input results. It does not describe precision or rounding behavior of returned figures.

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

Conciseness4/5

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

The output list is front-loaded in the first sentence and the defaults rule follows, so the agent reads the most decision-relevant content first. The first sentence is a dense comma-separated run-on, but no sentence is filler and overall length is appropriate for an 18-parameter tool.

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

Completeness3/5

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

With 18 parameters, no output schema, and 11 enums, the definition is reasonably complete on inputs and on default handling. However, nothing describes the shape of the returned figures beyond 'listed in the reply', so an agent cannot anticipate the response structure even though no output schema exists to carry that burden.

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 100%, so the schema already documents all 18 parameters, making 3 the baseline. The description adds a useful cross-cutting rule not expressed in the schema: every input is optional unless marked required, and left-out inputs resolve to documented page defaults returned in the response. That changes how an agent should construct calls but stops short of explaining interactions between units.

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

Purpose4/5

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

The description names a specific resource and set of outputs: swap earned or paid over a holding period, yearly carry yield, adverse price move before swap is exhausted, and cost of a sharp unwind. That is concrete enough for an agent to know exactly what it gets. It does not explicitly distinguish itself from the sibling calculate_swap, which an agent may confuse with carry-yield math.

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?

Usage context is implied by the carry-trade framing and the reference to the matching calculator page, so an agent can infer this is the multi-output carry scenario tool. There is no explicit when-to-use versus when-not clause, and no mention of the closely related calculate_swap sibling to route between them.

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