Skip to main content
Glama

Plan a rebalance

plan_rebalance
Read-only

Compare holdings to target allocation and generate sells, buys, and full exits to close the gap, reporting sells first and flagging when buys exceed available cash.

Instructions

Compare current holdings against a target allocation and produce the buys, sells and full exits that close the gap. Compares market value, not share count, so a name that has re-rated shows as overweight. Sells are reported before buys because the proceeds fund them, and the plan says explicitly when the buys are not fundable from cash plus proceeds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetsYes
holdingsYes
availableCashNoUninvested cash, folded into the portfolio value.
minTradeValueNoSuppress orders whose notional is below this.
driftToleranceNoIgnore drift below this fraction of target. Exits are never suppressed by it.
allowFractionalSharesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already carry readOnlyHint=true, so safety is covered; the description adds real behavioral context beyond them — value-weighted rather than share-count comparison, sells ordered before buys, and an explicit flag when buys are not fundable from cash plus proceeds. It reveals useful output semantics without restating the read-only trait. No permission or rate-limit detail is needed for a pure computation.

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?

Three sentences, front-loaded with the core action, and each clause carries new information (value basis, ordering, fundability warning). No filler or redundancy.

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 usefully characterizes the return shape (buys, sells, full exits, ordering, unfundable-buys notice). It is strong on output behavior but silent on several input knobs, leaving a small gap for a 6-parameter tool.

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 50% (targets/holdings subfields documented, top-level flags like allowFractionalShares bare). The description only obliquely touches availableCash via 'cash plus proceeds' and adds nothing on driftTolerance, minTradeValue, or weight normalization. This is the baseline-3 case where the schema does most of the work and the description fails to compensate for the gaps.

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?

States a specific verb and resource: 'Compare current holdings against a target allocation and produce the buys, sells and full exits that close the gap.' An agent immediately knows this computes a rebalancing plan. It does not, however, name or differentiate itself from the related sibling build_allocation (which plausibly produces the target the plan consumes).

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?

The description never states when to reach for this tool versus alternatives such as build_allocation, nor does it give prerequisites or exclusions. It describes how the tool behaves once called, but gives no routing guidance for an agent choosing between similar tools.

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