Skip to main content
Glama

FarmDash Agent OS

calculate_position_size

Read-onlyIdempotent

Calculate hypothetical Hyperliquid sizing, margin, leverage, and diagnostics from supplied equity and prices. The service caps leverage at 5x and risk at 2% of equity. Requires Pioneer, Syndicate, or eligible futures-strategy x402 subject to route terms. Sizing does not place an order or determine actual liquidation.

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": {
      "equity": "<equity>",
      "entryPrice": "<entryPrice>",
      "stopPrice": "<stopPrice>"
    },
    "name": "calculate_position_size"
  }
}

Input Schema

NameRequiredDescriptionDefault
equityYesTotal account equity in USD.
stopPriceYesStop price in USD per unit, different from entry. Below entry implies long, above implies short.
entryPriceYesProposed entry price in USD per unit.
riskPercentNoFraction of equity to risk. Use 0.01 for 1%. Defaults to the 2% cap before applying riskMultiplier.
targetPriceNoOptional target price in USD per unit used for reward/risk diagnostics.
riskMultiplierNoScale the requested fraction from 0.1 to 1. Defaults to 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / entryPrice / description
      Added value: +"Proposed entry price in USD per unit."
    • addedInput schema / properties / equity / description
      Added value: +"Total account equity in USD."
    • addedInput schema / properties / riskMultiplier / description
      Added value: +"Scale the requested fraction from 0.1 to 1. Defaults to 1."
    • addedInput schema / properties / riskPercent / description
      Added value: +"Fraction of equity to risk. Use 0.01 for 1%. Defaults to the 2% cap before applying riskMultiplier."
    • addedInput schema / properties / stopPrice / description
      Added value: +"Stop price in USD per unit, different from entry. Below entry implies long, above implies short."
    • addedInput schema / properties / targetPrice / description
      Added value: +"Optional target price in USD per unit used for reward/risk diagnostics."
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive, open-world), the description discloses concrete operating constraints: leverage capped at 5x, risk capped at 2% of equity, entitlement requirements tied to route terms, and two limits on interpretation ('does not place an order', 'does not determine actual liquidation'). That is exactly the extra context annotations cannot carry.

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 front-loaded sentences with no filler: first what it computes, then the hard risk/leverage caps, then access requirements and scope disclaimers. Each sentence adds a distinct fact an agent needs.

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 read-only six-parameter calculation tool with no output schema, the description covers purpose, caps, entitlements, and what the tool will not do. It names the output dimensions (sizing, margin, leverage, diagnostics) only briefly, leaving return shape somewhat under-described, but nothing critical for correct invocation is missing.

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 every parameter (equity, entryPrice, stopPrice, riskPercent, targetPrice, riskMultiplier) is already documented, including the 2% cap default and multiplier range. The description only restates that inputs are 'equity and prices' and adds no syntax or interaction detail beyond the schema, so the baseline 3 applies.

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 ('Calculate') and a precise resource set ('hypothetical Hyperliquid sizing, margin, leverage, and diagnostics'), and the phrase 'does not place an order' implicitly separates it from execution siblings like execute_perp_order. The only gap is that no sibling is named outright as the alternative path.

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 context for use: it is a hypothetical pre-trade calculation on supplied equity and prices, and it explicitly does not place orders, which steers order placement elsewhere. Access prerequisites (Pioneer, Syndicate, or eligible futures-strategy x402 subject to route terms) are stated, but there is no explicit 'use this instead of X' routing.

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