Skip to main content
Glama

rebalance_portfolio

Rebalance a multi-currency portfolio: given holdings, per-holding (or per-asset-class) target weights, cash and FX rates, return the exact BUY/SELL trades to reach the targets, the per-currency cash movements (flagging foreign-cash overdrafts), and a summary. Planning math only — no transaction costs or taxes.

Input Schema

NameRequiredDescriptionDefault
fx_ratesNoValue of 1 unit of each currency in the base currency (base currency itself is 1).
holdingsYesThe portfolio holdings to rebalance.
base_currencyNoBase currency the portfolio is valued in.USD
class_targetsNoOptional per-asset-class goal % (incl. "Cash"). When given, unlocked holdings are retargeted to hit each class goal before computing trades.
available_cashNoCash held per currency, keyed by ISO code.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / available_cash / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / class_targets / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / fx_rates / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / holdings / items / additionalProperties
      Removed value: -false
  2. Added

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses the return shape (exact trades, per-currency cash movements, overdraft flags, summary) and an important scope limit (no costs/taxes). It stops short of stating determinism, error behavior on infeasible targets, or how locked holdings are treated.

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 carries the inputs and outputs, followed by a short scoping clause; nothing is wasted. It is dense and slightly list-heavy but structurally sound.

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 nested, five-parameter planning tool with no output schema and no annotations, the description covers inputs, returned artifacts, and a key behavioral limit. Remaining gaps (target normalization, locked-holding effects, failure modes) are secondary but real.

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%, so the baseline is 3; the schema already documents fx_rates, class_targets, available_cash and every holding field. The description's mention of per-holding vs per-asset-class targets and FX/cash inputs maps to those parameters but adds no format or constraint detail beyond the schema.

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 names a specific verb and resource ('Rebalance a multi-currency portfolio') and enumerates both required inputs and returned artifacts (BUY/SELL trades, per-currency cash movements, summary). It does not, however, distinguish itself from the sibling get_rebalance_plan, which sounds like it may do the same thing.

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?

Usage is only implied by the input enumeration; there is no explicit statement of when to call this versus get_rebalance_plan or the other portfolio tools. The one scoping exclusion offered ('Planning math only — no transaction costs or taxes') narrows the domain but is a capability limit, not routing 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