Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Forex Average Entry

workflow.run_forex_average_entry
Read-only

Size-weighted (arithmetic) average entry price across multiple forex fills. Edge cases: at least 1 fill; every price and units above zero; pair is BASE/QUOTE with two different ISO 4217 codes (a metal such as XAU/USD is accepted here because no pip is needed). The average is weighted by units, not by cash. Not covered: swap, commission, spread, fills in different pairs, and closing fills (buys only). Use when user asks "what's my average entry after these fills?". Returns: totalUnits, totalCost, avgEntry.

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": {
      "pair": "<pair>",
      "fills": "<fills>"
    },
    "name": "workflow.run_forex_average_entry"
  }
}

Input Schema

NameRequiredDescriptionDefault
pairYesCurrency pair in BASE/QUOTE format, e.g. "EUR/USD"
fillsYesFills to average, each with a price and a size in base-currency units

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / fills / items / properties / price / description
      Added value: +"Fill price"
    • addedInput schema / properties / fills / items / properties / units / description
      Added value: +"Fill size in base-currency units"
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already establish readOnly/non-destructive/closed-world, but the description adds substantive behavior the annotations cannot: the average is weighted by units not cash, only buy fills count, and validation preconditions (>=1 fill, all prices and units > 0, two distinct ISO 4217 codes) are spelled out. It even clarifies the deliberate metal exception (XAU/USD allowed because no pip is needed), which prevents a plausible mis-selection.

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?

Front-loaded with the computation, then edge cases, then exclusions, then trigger phrase, then return fields — a sensible ordering with no filler sentences. The metal-currency parenthetical is slightly dense on first read, but it carries real disambiguation value rather than padding.

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?

Although there is no output schema, the description names the returned fields (totalUnits, totalCost, avgEntry), so the agent knows what it gets back. With only two parameters, full schema coverage, and annotations covering the safety profile, nothing needed to call this correctly 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 coverage is 100%, so the baseline is 3, and the description earns above that by constraining 'pair' to BASE/QUOTE with two different ISO 4217 codes and by clarifying that weighting is by units (base-currency units) rather than notional cash. It does not add per-field format or range detail beyond the schema for 'price', but the added pair and weighting semantics are the meaningful ones.

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 (size-weighted arithmetic average entry price) over a specific resource (multiple forex fills), and immediately narrows scope with 'buys only' and 'fills in different pairs' excluded. That scope language is what separates it from siblings like run_average_buy_price or primitive.average_entry without needing to name them.

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 an explicit trigger phrase ('Use when user asks "what's my average entry after these fills?"') plus a concrete 'Not covered' list (swap, commission, spread, cross-pair fills, closing fills), which functions as real when-not guidance. It stops short of routing the agent to a named alternative for those excluded cases, so it is clear context rather than full alternative routing.

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.