Skip to main content
Glama

AlgoVault — Crypto Quant Trade Calls

pre_trade_check

Read-only

Returns a pre-trade check of a crypto perpetual futures order against your own rules: each passes or fails with its numbers, then GO, CAUTION or WAIT. Adds isolated liquidation distance, whether it hits before your stop, fees, accuracy needed to break even over your hold, funding by venue (cross-venue) and the regime. Read-only: places no orders.

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": {
      "coin": "<coin>",
      "side": "<side>",
      "sizeUsd": "<sizeUsd>"
    },
    "name": "pre_trade_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesAsset symbol, e.g. BTC, ETH, SOL.
sideYesDirection of the order you intend to place: long or short.
rulesNoYour rules, each key optional. Saved rules apply too; a failed one returns WAIT.
sizeUsdYesOrder notional in USD, e.g. 10000.
stopPctNoStop-loss distance from entry in percent, e.g. 2.
leverageNoIsolated leverage you will use, e.g. 10. Enables the liquidation checks.
equityUsdNoAccount equity in USD. Enables the percent-of-equity rules.
exchangesNoOnly compare these venues (default: every supported venue).
holdHoursNoExpected holding time in hours (default 8); sets the funding cost window.
orderTypeNomarket (taker entry) or limit (maker entry). Default market.market
targetPctNoTarget distance from entry in percent, e.g. 4.
timeframeNoMarket-regime timeframe: 1h, 4h or 1d (default 4h).4h

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / rules / properties / regimeCheck / description
      Previous value: -"Flag a regime against your side or a volatile one. Default on."New value: +"Flag a regime against your side. Default on."
  2. Changed1 schema field changed
    • changedInput schema / properties / rules / description
      Previous value: -"Your rules, each key optional. A rule of yours that fails returns WAIT."New value: +"Your rules, each key optional. Saved rules apply too; a failed one returns WAIT."
  3. Changed6 schema fields changed
    • addedInput schema / properties / equityUsd
      Added value: +{
      +  "description": "Account equity in USD. Enables the percent-of-equity rules.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 10000000000,
      +  "type": "number"
      +}
    • addedInput schema / properties / leverage
      Added value: +{
      +  "description": "Isolated leverage you will use, e.g. 10. Enables the liquidation checks.",
      +  "maximum": 200,
      +  "minimum": 1,
      +  "type": "number"
      +}
    • addedInput schema / properties / orderType
      Added value: +{
      +  "default": "market",
      +  "description": "market (taker entry) or limit (maker entry). Default market.",
      +  "enum": [
      +    "market",
      +    "limit"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / rules
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Your rules, each key optional. A rule of yours that fails returns WAIT.",
      +  "properties": {
      +    "maxAccuracyNeededPct": {
      +      "description": "Highest direction accuracy, in percent, needed to break even.",
      +      "maximum": 100,
      +      "minimum": 50,
      +      "type": "number"
      +    },
      +    "maxDailyMovePctEquity": {
      +      "description": "Largest equity swing, in percent, from a one-sigma daily move.",
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "maxFundingBps": {
      +      "description": "Highest funding over the hold, in bps. Default 10.",
      +      "maximum": 10000,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "maxLeverage": {
      +      "description": "Highest leverage you allow.",
      +      "maximum": 200,
      +      "minimum": 1,
      +      "type": "number"
      +    },
      +    "maxLossAtStopPctEquity": {
      +      "description": "Most equity, in percent, you accept losing at your stop.",
      +      "maximum": 100,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "maxRoundTripBps": {
      +      "description": "Highest round trip in fees plus spread, in bps.",
      +      "maximum": 1000,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "maxSizePctOf24hVolume": {
      +      "description": "Largest order as a percent of a venue's 24h volume. Default 0.1.",
      +      "exclusiveMinimum": 0,
      +      "maximum": 100,
      +      "type": "number"
      +    },
      +    "minLiqDistanceSigma": {
      +      "description": "Liquidation at least this many hold-period volatilities away.",
      +      "maximum": 50,
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "noLiqBeforeStop": {
      +      "description": "Fail if liquidation would come before your stop. Default on.",
      +      "type": "boolean"
      +    },
      +    "regimeCheck": {
      +      "description": "Flag a regime against your side or a volatile one. Default on.",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / stopPct
      Added value: +{
      +  "description": "Stop-loss distance from entry in percent, e.g. 2.",
      +  "maximum": 50,
      +  "minimum": 0.01,
      +  "type": "number"
      +}
    • addedInput schema / properties / targetPct
      Added value: +{
      +  "description": "Target distance from entry in percent, e.g. 4.",
      +  "maximum": 1000,
      +  "minimum": 0.01,
      +  "type": "number"
      +}
  4. Added

TDQS

A3.8/5.0
Behavior4/5

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

The description says what the checks actually compute: isolated liquidation distance, whether liquidation arrives before the stop, fees, accuracy needed to break even over the hold, cross-venue funding and regime, then renders a verdict. That goes beyond what annotations alone convey (read-only, open-world, non-destructive), which the description also confirms with 'places no orders.' It doesn't mention latency, venue-data dependency or how saved rules interact with supplied rules, so the definition is strong rather than complete.

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?

The output shape and verdicts are front-loaded, followed by the additive checks and then the read-only guarantee. Every sentence carries information, though the middle enumeration of checks is dense and reads as a list compressed into prose. Slightly tighter phrasing would improve scanning without losing content.

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 12 parameters, a nested rules object and no output schema, the description carries real weight and delivers: it explains that each rule returns a pass/fail with numbers, then an overall verdict. That is enough for an agent to interpret the return value without an output schema. Gaps remain around behavior when saved rules conflict with supplied rules and around failure modes.

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?

With schema description coverage at 100%, the baseline is 3, but the description maps several rule parameters to their intent by name: liquidation distance, liquidation-before-stop, fees, break-even accuracy, cross-venue funding and regime. That linkage helps an agent understand which optional inputs activate which output sections. It still doesn't explain the documented defaults or the equity-dependent rules, so it is not a full semantic treatment.

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?

The definition uses a specific verb and resource: it returns a pre-trade check of a crypto perpetual futures order against the user's own rules, and it names the output vocabulary (per-rule pass/fail plus GO, CAUTION or WAIT). An agent can distinguish it from signal-oriented siblings such as get_trade_call or get_trade_signal because it validates a proposed order rather than proposing one. It never names a sibling, so the differentiation is inferred rather than explicit.

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: the name and the phrase 'pre-trade check' suggest calling it before placing an order, and 'Read-only: places no orders' implies execution happens elsewhere. There is no explicit when-to-use or when-not clause, no prerequisites about what inputs enable which checks, and no named alternative tool. An agent has to infer the workflow context.

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.