Skip to main content
Glama

BRAINIAC Portfolio Analytics

Rebalance trades to target weights

portfolio-analytics_rebalance-trades
Read-onlyIdempotent

Compute buys and sells that restore target weights with tolerance bands, a cash buffer, minimum trade size and whole-share rounding. Price $0.03 USDC. POST /api/v1/portfolio-analytics/rebalance-trades. An unpaid call returns the x402 payment terms and does not run.

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": {
      "holdings": "<holdings>",
      "targets": "<targets>"
    },
    "name": "portfolio-analytics_rebalance-trades"
  }
}

Input Schema

NameRequiredDescriptionDefault
bandNoband, object. Required.
cashNocash, number, from 0 to any. Required.
targetsYestargets, object. Required.
holdingsYesholdings, array. Required.
cashBufferNocashBuffer, number, from 0 to 0.5. Required.
fractionalNofractional, boolean. Required.
restrictedNorestricted, array. Required.
minTradeValueNominTradeValue, number, from 0 to any. Required.

Output Schema

NameRequiredDescriptionDefault
tradesNotrades. Array.
sourcesNosources. Array.
cashAfterNocashAfter. Number.
untouchedNountouched. Array.
investableNoinvestable. Number.
totalValueNototalValue. Number.
limitationsNolimitations. Array.
weightsAfterNoweightsAfter. Object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description adds genuinely non-structured behavior: a hard price of $0.03 USDC and, importantly, that an unpaid call returns x402 payment terms without executing — a critical operational trait an agent cannot see anywhere else.

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?

Four short sentences, front-loaded with the purpose before payment and transport details, with no filler. The endpoint path is marginally redundant with the tool name but does not dilute the opening.

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 an output schema present the description need not explain return values, and it covers the payment gate, the endpoint, and the main rounding/buffer semantics for an 8-parameter nested-input tool. Gaps remain around the restricted-symbols list and the targets map, but the schema carries those.

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, and the descriptions there are largely placeholder text ('band, object. Required.'). The prose does add real meaning by naming what band, cash buffer, minTradeValue and fractional actually control, but it leaves targets, restricted and cash unexplained, so it does not rise far above baseline.

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 pair ('Compute buys and sells that restore target weights') and enumerates the controlling knobs (tolerance bands, cash buffer, minimum trade size, whole-share rounding), which distinguishes it in spirit from weight-producing siblings like mean-variance-optimize or risk-parity-weights. It stops short of naming any sibling explicitly, so it lands just below the top mark.

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: rebalancing presupposes existing holdings that have drifted from targets, but the description never states when to prefer this over the optimizer or x-ray tools, nor any when-not condition. An agent can infer the scenario but is given no routing rule.

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