Skip to main content
Glama
IBKR MCP Server

IBKR MCP Server

calculate_rebalancing_orders

Determine the trades required to rebalance a portfolio to target allocations, optionally using available cash and applying a rebalance threshold.

Instructions

Calculate trades needed to rebalance portfolio to target allocations.

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": {
      "target_allocations": "<target_allocations>"
    },
    "name": "calculate_rebalancing_orders"
  }
}

Input Schema

NameRequiredDescriptionDefault
use_cashNo
target_allocationsYes
rebalance_thresholdNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. 'Calculate' implies a non-mutating computation, but the definition never states that no orders are placed, nor explains how rebalance_threshold alters which positions are flagged. Key behavioral context is absent.

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?

A single front-loaded sentence with the action and object in the right order and no filler. It is tight, though the brevity is partly the source of the missing guidance rather than a virtue in itself.

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?

An output schema exists, so return values need not be described. However, for a three-parameter tool with a nested allocation map and no annotations, the definition leaves the two optional flags and the calculate/execute boundary unexplained.

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% for all three parameters, and the description compensates only partially by naming target allocations. The meaning of use_cash (default true) and rebalance_threshold (default 0.05) — a drift tolerance — is entirely undocumented, and those two flags materially change the output.

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 gives a specific verb ('Calculate') plus the exact resource ('trades needed to rebalance portfolio to target allocations'), so an agent knows precisely what it produces. It does not explicitly contrast itself with execute_rebalancing, leaving the calculate-vs-execute distinction to inference from the verb.

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 versus actually placing orders, nor any note that the output is a proposed order set that must be fed to an execution tool. No prerequisites or exclusions are stated.

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