Skip to main content
Glama
traivo-mcp
by traivoxyz

Position size

size_position
Read-onlyIdempotent

Calculate a position size from entry, stop, and a max-loss budget or account risk percentage, with optional fees, gas, target R-multiple, and notional cap.

Instructions

Pure local math, no network: size a position from a max loss and a stop. quantity = risk budget / loss per unit at the stop (plus optional per-side costs and flat Ethereum gas per swap). Give risk_usd, or account_usd with risk_pct. Direction is inferred from the stop (stop below entry = buy). Optional target returns the R multiple and reward; optional max_notional_usd caps the size.

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": {
      "entry": "<entry>",
      "stop": "<stop>"
    },
    "name": "size_position"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideNoOptional check: must agree with the stop (buy = stop below entry).
stopYesStop price; the trade is closed here.
entryYesEntry price.
targetNoTake-profit price, for the R multiple.
gas_usdNoEthereum gas per swap in USD, paid on entry and exit (default 0 = not included).
cost_bpsNoFees + slippage per side in bps (default 0).
risk_pctNoPercent of account_usd to risk, e.g. 1 for 1%.
risk_usdNoMax loss in USD if the stop is hit.
account_usdNoAccount size in USD (with risk_pct).
max_notional_usdNoCap on position value in USD, e.g. your balance.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, and the description reinforces the no-network claim. It goes further by disclosing what is computed (risk budget / loss per unit, plus per-side costs and flat gas), that direction is inferred, and what the optional target returns (R multiple and reward) — useful since there is no output schema.

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?

Front-loaded with the key constraint (local math, no network) before the formula and input rules, with no filler. It is dense to the point of being slightly run-on, but every clause carries operative information.

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 10-parameter computation tool with no output schema, the description covers the input alternatives, the direction inference, the optional outputs, and the notional cap. Minor gaps remain, such as rounding of quantity or what happens when side conflicts with the stop, but nothing blocking correct invocation.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaning the schema does not: risk_usd and account_usd+risk_pct are alternatives, direction comes from the stop relationship, and max_notional_usd caps position value. The 'must agree with the stop' semantics of side are echoed and clarified beyond the enum.

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?

States a specific verb and resource ('size a position from a max loss and a stop') and immediately disambiguates from the network-based siblings with 'Pure local math, no network', which sets it apart from get_trade_quote and prepare_trade_link. The core formula is included, so an agent knows exactly what computation it gets.

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

Usage Guidelines4/5

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

Gives clear preconditions for invocation: 'Give risk_usd, or account_usd with risk_pct', and explains that direction is inferred from the stop. It does not explicitly name which sibling to use instead for quoting versus sizing, so the when-not guidance is implied rather than stated.

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