Skip to main content
Glama

TradingCalc MCP — Crypto Futures Math

primitive.average_entry

Calculate the weighted average entry price from multiple buy/sell fills (DCA). Use when user has filled at multiple prices and asks "what's my average entry?" Returns: averagePrice, totalSize, totalCost.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes
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. 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"
      +}
  2. Added

TDQS

A3.5/5.0
Behavior2/5

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

The description discloses that it returns averagePrice, totalSize, and totalCost, but does not explicitly state it is side-effect-free or read-only. More importantly, the top-level 'weighted average' wording contradicts the parameter description's arithmetic/harmonic mean behavior, so the actual calculation is not transparent.

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?

The description is concise, with two sentences covering purpose, use case, and return fields. It avoids unnecessary detail and is well-structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

It provides enough context for a simple average-entry calculation and names the output fields, but lacks output schema, edge-case behavior (e.g., empty fills, sell fills), and a clear statement of the formula. The weighted-vs-arithmetic contradiction further reduces completeness.

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?

Most parameters are described, including the linear/inverse distinction and quantity units for inverse. However, the fills array itself lacks a description, and the relationship between 'weighted average' and the arithmetic/harmonic formulas is not reconciled, leaving some ambiguity about how price and quantity interact.

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 description clearly states the tool calculates an average entry price from multiple DCA fills and specifies when to use it. However, the phrase 'weighted average' conflicts with the contractType parameter describing linear as an arithmetic mean, creating mild ambiguity about the exact calculation.

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 explicitly says to use when a user has filled at multiple prices and asks for average entry, which is a clear trigger condition. It does not mention alternatives or when not to use it, but the primitive nature and sibling workflows provide enough 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.