Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

DCA Entry

workflow.run_dca_entry
Read-only

DCA entry planner: weighted average entry price, breakeven, and per-level contribution from multiple fill prices and sizes. Each fill is { price, size } here (primitive.average_entry calls the same field quantity). Compared with primitive.average_entry, this one adds output for the case where breakeven or the per-level breakdown is also wanted, not just the bare average. Edge cases: 2 to 20 fills (size also accepted as quantity), each price and size above zero; fee_open_pct and fee_close_pct are fractions from 0 to 0.05 (defaults 0.0002 and 0.0005); every fill is on the same side and the same contract type. Not covered: fills at different times with different fees, partial closes, funding paid while the position was open, and liquidation (use workflow.run_liquidation_safety). Use when user bought at several prices and asks "what's my average entry?" or "where is my DCA breakeven?". Returns: averageEntry, breakeven, per-level summary.

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": {
      "side": "<side>",
      "entries": "<entries>"
    },
    "name": "workflow.run_dca_entry"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesTrade direction: "long" or "short"
entriesYesFills to average (2 to 20). Each: { price, size }, e.g. [{ "price": 60000, "size": 0.5 }, { "price": 58000, "size": 1 }]. Size is base-asset quantity for linear, USD notional (contracts) for inverse.
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. Each fill's size is USD notional (contracts) for inverse; averageEntry is then the harmonic mean of fill prices, not the arithmetic mean.
fee_open_pctNoOpen fee rate (default 0.0002)
fee_close_pctNoClose fee rate (default 0.0005)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / entries / items / properties / quantity
      Added value: +{
      +  "description": "Same field as size",
      +  "type": "number"
      +}
    • changedInput schema / properties / entries / items / properties / size / description
      Previous value: -"Fill size"New value: +"Fill size, required unless \"quantity\" is given (the same field)"
    • changedInput schema / properties / entries / items / required
      Previous value: -[
      -  "price",
      -  "size"
      -]New value: +[
      +  "price"
      +]
  2. Changed4 schema fields changed
    • addedInput schema / properties / entries / description
      Added value: +"Fills to average (2 to 20). Each: { price, size }, e.g. [{ \"price\": 60000, \"size\": 0.5 }, { \"price\": 58000, \"size\": 1 }]. Size is base-asset quantity for linear, USD notional (contracts) for inverse."
    • addedInput schema / properties / entries / items / properties / price / description
      Added value: +"Fill price"
    • addedInput schema / properties / entries / items / properties / size / description
      Added value: +"Fill size"
    • addedInput schema / properties / side / description
      Added value: +"Trade direction: \"long\" or \"short\""
  3. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined. Each fill's size is USD notional (contracts) for inverse; averageEntry is then the harmonic mean of fill prices, not the arithmetic mean.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare it is a non-destructive, closed-world read, so the bar is lower and the description clears it comfortably: it discloses validation bounds (2-20 fills, prices/sizes above zero, fees as fractions 0-0.05 with defaults), an input-consistency precondition (all fills same side, same contract type), and an explicit exclusion list (multi-time fees, partial closes, funding, liquidation). That is exactly the context an agent needs before calling.

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?

It is front-loaded with purpose, then scope, then edge cases, then return shape, so the highest-value sentence comes first. The parenthetical cross-references and dense semicolon chains make it heavier than necessary, but no sentence is filler.

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?

There is no output schema, and the description compensates by naming the returned fields (averageEntry, breakeven, per-level summary). Combined with the stated input preconditions and the explicit non-coverage list pointing to workflow.run_liquidation_safety, an agent has everything needed to call it correctly.

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 100% schema coverage the baseline is 3, and the description earns one point above by adding constraints absent from the schema: the 0-0.05 fee-rate range and the same-side/same-contract-type requirement. It also reinforces the size/quantity aliasing across tools, though the 2-20 fill bounds are already encoded as minItems/maxItems.

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 opens with a specific verb+resource ("DCA entry planner") and enumerates the exact outputs (weighted average entry price, breakeven, per-level contribution). It explicitly contrasts itself with primitive.average_entry, so an agent can pick it without opening either schema.

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?

It names a concrete trigger ("user bought at several prices and asks 'what's my average entry?' or 'where is my DCA breakeven?'") and gives a routing rule versus primitive.average_entry (use this one when breakeven or per-level breakdown is wanted). It does not differentiate against the many other averaging/breakeven workflow siblings such as run_average_buy_price, run_average_down, run_spot_dca, or run_breakeven_planning, which is a real gap in a crowded namespace.

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.