Skip to main content
Glama

Investember financial data

Forex position size

calculate_position_size
Read-onlyIdempotent

Position size in lots for a trade that risks a set share of the account at a given stop loss distance in pips. Converts the pip value into the account currency with the latest ECB reference rates.

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": {
      "account_balance": "<account_balance>",
      "risk_percent": "<risk_percent>",
      "stop_loss_pips": "<stop_loss_pips>",
      "instrument": "<instrument>"
    },
    "name": "calculate_position_size"
  }
}

Input Schema

NameRequiredDescriptionDefault
pip_sizeNoSize of one pip in the quote currency. Default: 0.01 for JPY quotes, 0.0001 otherwise.
instrumentYesCurrency pair as six letters, base then quote.
risk_percentYesShare of the balance to risk, in percent.
contract_sizeNoUnits per standard lot.
stop_loss_pipsYesStop loss distance in pips.
account_balanceYesAccount balance in the account currency.
account_currencyNoCurrency of the account, ISO 4217 code.USD

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds genuinely useful context beyond that: conversion into account currency uses the latest ECB reference rates, which tells the agent the result depends on an external rate snapshot. However, it does not disclose rate staleness, behavior on unsupported pairs, or rounding of the resulting lot size, and 'latest ECB reference rates' sits in mild tension with openWorldHint=false (presumably a cached internal feed) without clarifying which.

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?

Two sentences, both load-bearing: the first defines the computation and its inputs, the second flags the currency-conversion mechanism. Nothing is repeated from the schema and there is no filler.

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 seven-parameter pure calculator with full schema coverage and no output schema, the description covers the essentials, including what is returned (position size in lots). The remaining gap is output detail: no mention of lot rounding, minimum lot handling, or failure modes when a rate is unavailable.

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

Parameters3/5

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

Schema description coverage is 100%, with defaults, ranges, and examples for all seven parameters, so the schema already carries parameter meaning. The description only restates three concepts (account risk share, stop-loss pips, pip-value conversion) at a conceptual level and adds no format, unit, or resolution detail (e.g. how account_currency pairs with instrument). Baseline 3 applies.

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 states precisely what is computed: a lot-denominated position size from account balance, risk share, stop-loss pips, and instrument. That is far more specific than the title and cannot be confused with the data-retrieval siblings (exchange rates, economic calendar, sentiment). It stops short of a 5 only because it does not use an explicit verb-and-object framing or name a boundary against any alternative.

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?

Intended usage is implied by 'for a trade that risks a set share of the account', so an agent can infer this is a pre-trade sizing calculation. There is no explicit statement of when to use it versus alternatives, no prerequisite note (e.g. that a valid instrument and stop distance are needed), and no exclusions or edge-case guidance.

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