Skip to main content
Glama

Amaltash Investment & Retirement Calculators

Stock Average Calculator

calculate_average_cost
Read-onlyIdempotent

Stock Average Calculator with a chart, the same math as the web page. What did your shares cost on average? Bought the same stock more than once? Type each buy. You get your average cost for one share. It adds up what you paid for every buy and divides by your total shares. It also shows what one more buy would do. It does not say whether to buy more. People ask for it as "stock average calculator", "average down calculator" or "how to calculate average stock price".

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calculate_average_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
p1NoPrice per share, buy 1. US dollars. Default: 40.
p2NoPrice per share, buy 2. US dollars. Default: 52.
p3NoPrice per share, buy 3. US dollars. Default: 34.
s1NoShares bought, buy 1. Default: 20.
s2NoShares bought, buy 2. Default: 10.
s3NoShares bought, buy 3. Default: 30.
nowNoPrice per share now. US dollars. Shows your profit or loss. Default: 30.
targetNoAverage you want to reach. US dollars. Shares to buy at the price now. Default: 36.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish readOnly, idempotent, closed-world, non-destructive behavior, so the bar is lower. The description still adds real value by disclosing the computation (sum of all purchase costs divided by total shares), the extra outputs (profit/loss at the current price, shares needed to reach a target average), and an explicit scope limit that it gives no buy/sell recommendation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core sentence explaining the arithmetic is efficient and the non-advice disclaimer earns its place. But the opening chart/web-page framing and the trailing SEO keyword list ("stock average calculator", "average down calculator", "how to calculate average stock price") are search bait that adds nothing for an agent and pushes useful content later.

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 8 optional parameters at full schema coverage and no output schema, the description needs to explain what comes back, and it does: average cost per share, profit or loss versus the current price, and shares to buy at the current price to hit a target. Only the exact response shape and error behavior are unstated, which is a minor gap for a deterministic calculator.

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 already documents its meaning, units, and default. The description only adds the framing that each p/s pair is one buy and that "now" and "target" drive the profit/loss and target-average extras, which is a marginal gain over the schema. Baseline 3 applies when the schema does the heavy lifting.

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 states a concrete verb and resource: it averages what was paid across multiple buys of the same stock and divides total cost by total shares, and it also projects the effect of one more buy. That is specific enough to distinguish it from a generic ROI or position-sizing tool, but it never names or contrasts a sibling, and the opening phrase about a chart and a web page dilutes the front-loaded purpose.

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 implied rather than stated: "Bought the same stock more than once? Type each buy" tells the agent the input pattern, and "It does not say whether to buy more" rules out advice. However, there is no explicit when-to-use guidance and no routing against alternatives such as position_size or dca_vs_lump_sum, so the agent must infer the choice.

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