Skip to main content
Glama

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

Average Entry Price

primitive.average_entry
Read-only

Calculate the weighted average entry price from multiple buy/sell fills (DCA): the bare number only, no breakeven or per-fill breakdown. Use when user asks only "what's my average entry?" and wants just that figure. Each fill is { price, quantity } here (workflow.run_dca_entry calls the same field size). For breakeven and a per-level summary too, use workflow.run_dca_entry instead. Returns: averagePrice, totalSize, totalCost.

Input Schema

NameRequiredDescriptionDefault
inputYesObject with a "fills" array, e.g. { "fills": [{ "price": 60000, "quantity": 0.5 }, { "price": 58000, "quantity": 1 }] }
symbolYesTrading pair symbol, e.g. BTCUSDT
contractTypeNolinear = USDT-margined, average is the arithmetic mean (default). inverse = coin-margined, average is the harmonic mean (fill quantity is USD notional).
exchangeCodeNoExchange identifier (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / input / description
      Added value: +"Object with a \"fills\" array, e.g. { \"fills\": [{ \"price\": 60000, \"quantity\": 0.5 }, { \"price\": 58000, \"quantity\": 1 }] }"
    • addedInput schema / properties / input / properties / fills / description
      Added value: +"Buy/sell fills to average, each with a price and a quantity (at least 1)"
  2. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined, average is the arithmetic mean (default). inverse = coin-margined, average is the harmonic mean (fill quantity is USD notional).",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and closed-world scope, so the safety profile is covered. The description adds useful context by naming the return fields (averagePrice, totalSize, totalCost) and by clarifying the fill field name ('size' elsewhere vs quantity here), but says nothing about validation failures or how sells are treated in the weighting.

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-loads the core action and the output scope, then the usage rule, then the alternative. Dense but purposeful; the parenthetical asides about field naming make it slightly heavier than necessary for a simple primitive.

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?

No output schema exists, and the description compensates by enumerating the three returned fields, so an agent knows what comes back. With full schema coverage and a clear safety annotation set, the remaining gap (behavior of sell fills or inverse contracts) is minor.

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 coverage is 100%, so fills, symbol, contractType, and exchangeCode are already documented, including the arithmetic-vs-harmonic mean distinction for contractType. The description only reinforces the { price, quantity } shape and cross-references the sibling's field naming, which is a marginal addition over the schema.

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 (weighted average entry price from multiple fills) and bounds the output precisely: 'the bare number only, no breakeven or per-fill breakdown'. It distinguishes itself from the closest sibling by naming workflow.run_dca_entry as the fuller alternative.

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

Usage Guidelines5/5

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

Gives an explicit trigger ('use when user asks only "what's my average entry?"') and an explicit redirect rule ('for breakeven and a per-level summary too, use workflow.run_dca_entry instead'). The condition selecting the alternative is stated, not inferred.

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.