Skip to main content
Glama

compute_rebalance_plan

Generate a dry-run plan of market orders to rebalance your portfolio to target weights, using a drift threshold to trigger orders, without executing any trades.

Instructions

Compute (dry-run, nothing executed) the MARKET orders needed to move the portfolio to target weights. target_weights_json is a JSON object like {"BTC": 0.5, "ETH": 0.3, "USDT": 0.2} — fractions summing to ~1.0. threshold: minimum weight drift before an order is generated. Review the plan, then use prepare_rebalance to get a confirmation token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thresholdNo
target_weights_jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description must disclose behavioral traits itself. It explicitly states 'dry-run, nothing executed,' which is the critical non-destructive behavior. However, it does not mention other potential behaviors like what the plan contains, limits, or error conditions. The main safety aspect is covered, so a 4 is appropriate.

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?

The description is two sentences, front-loaded with the key dry-run behavior, then parameter explanations, then the next-step pointer. No fluff, every sentence earns its place. It is concise and well-structured.

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

Completeness5/5

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

Given the output schema exists, return values are not required. The description covers purpose, parameter semantics, behavioral safety, and the follow-up workflow. It is complete for an agent to correctly invoke the tool and understand its role among siblings, such as prepare_rebalance.

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

Parameters5/5

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

The schema provides only types and a default, with 0% coverage. The description fully compensates by explaining target_weights_json with an example and a constraint (fractions summing to ~1.0), and threshold as 'minimum weight drift before an order is generated.' This adds meaningful semantics beyond the schema, making parameter usage clear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as a dry-run computation of MARKET orders to reach target portfolio weights. The verb 'Compute' and specific resource 'rebalance plan' are present, and the dry-run qualifier immediately distinguishes it from execution tools like prepare_rebalance.

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

Usage Guidelines5/5

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

The description explicitly states the intended workflow: 'Review the plan, then use prepare_rebalance to get a confirmation token.' This tells the agent exactly when to use this tool (before preparing a rebalance) and points to the next step. It implies this is for planning only, not execution, which is a clear usage boundary.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alejandrorodm/MCP-Pionex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server