Skip to main content
Glama

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

Forex Margin Level

workflow.run_forex_margin_level
Read-only

Free margin and margin level % from account equity and used margin: equity/usedMargin*100, the same stop-out proximity metric every forex platform shows. Returns null (not Infinity) when usedMargin is 0, meaning no open position. Edge cases: equity above zero, usedMargin zero or more; usedMargin of 0 returns marginLevelPct null (no open position), not a large number; equity below used margin gives a level under 100. Not covered: a broker margin-call or stop-out threshold (they differ by broker), pending orders, hedged-position margin offsets, and swap or commission not yet charged. Use when user asks "how close am I to a margin call?" or "what's my free margin?". Returns: freeMargin, marginLevelPct.

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": {
      "equity": "<equity>",
      "usedMargin": "<usedMargin>"
    },
    "name": "workflow.run_forex_margin_level"
  }
}

Input Schema

NameRequiredDescriptionDefault
equityYesAccount equity (balance + floating P&L)
usedMarginYesMargin currently locked by open positions. 0 if none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover read-only and non-destructive safety, and the description adds genuinely new behavioral detail: null rather than Infinity on zero usedMargin, and a sub-100 level when equity is below used margin. It does not state rounding/precision or unit conventions for the percentage, which keeps it from a 5.

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

Conciseness3/5

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

The core formula and usage triggers are front-loaded, but the zero-usedMargin/null behavior is stated twice in near-identical wording ("Returns null (not Infinity)..." and "usedMargin of 0 returns marginLevelPct null... not a large number"), which is redundant in an otherwise dense paragraph.

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?

With no output schema, the description takes on return-value disclosure and does list the returned fields plus the null edge case. For a two-parameter pure calculation that is nearly sufficient; missing precision/formatting of the percentage is a minor gap.

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; the description still adds meaning by explaining that usedMargin=0 means no open position and drives a null result, and that equity below used margin yields a level under 100. These are semantic consequences the schema alone does not convey.

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 names the exact computation (equity/usedMargin*100) and the two outputs (freeMargin, marginLevelPct), which unambiguously separates it from sibling tools like run_forex_margin_required. An agent can tell what this tool computes without opening the 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?

It gives concrete trigger phrasings ("how close am I to a margin call?", "what's my free margin?") and an explicit exclusions list (broker stop-out thresholds, pending orders, hedged offsets, uncharged swap/commission). It stops short of naming an alternative sibling tool for those excluded cases, so it is clear context but not 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.