Skip to main content
Glama
IBKR MCP Server

IBKR MCP Server

calculate_position_size

Calculate trade position size from risk amount, stop-loss, and optional entry price to control risk before order execution.

Instructions

Calculate optimal position size based on risk parameters.

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": {
      "symbol": "<symbol>",
      "risk_amount": "<risk_amount>",
      "stop_loss": "<stop_loss>"
    },
    "name": "calculate_position_size"
  }
}

Input Schema

NameRequiredDescriptionDefault
methodNofixed_risk
symbolYes
stop_lossYes
entry_priceNo
risk_amountYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it says nothing about whether this is a pure read-only calculation with no side effects, how the `method` parameter changes the sizing algorithm, or what happens when `entry_price` is omitted (presumably current market price). For a 5-parameter financial calculation with zero annotation coverage, this is a significant gap.

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?

It is a single front-loaded sentence with no wasted words, but the brevity reflects under-specification rather than economy given the tool's five parameters. It is structurally clean but too thin for the complexity.

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

Completeness2/5

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

An output schema exists, so return values need not be described. However, with 5 parameters at 0% schema coverage and no annotations, the definition leaves the agent unable to determine the meaning of `method`, the role of `entry_price`, or the tool's side-effect profile.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate, but "based on risk parameters" only loosely gestures at risk_amount and stop_loss and adds nothing about `symbol`, `entry_price`, or the `method` string (default "fixed_risk") which appears to select the sizing algorithm. The most consequential parameter, `method`, is left entirely unexplained.

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 pairs a specific verb ("Calculate") with a specific resource ("optimal position size") and a stated basis ("risk parameters"), which is enough to distinguish it from sibling calculators like calculate_var or calculate_slippage. It stops short of naming any sibling or scope boundary explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to call this tool versus alternatives such as calculate_rebalancing_orders or check_risk_limits, and no stated prerequisites (e.g., that a stop loss and entry price must be known first). Usage must be inferred entirely from the name.

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