Skip to main content
Glama

Profit per sale

calculate_profit_per_sale
Read-onlyIdempotent

Works out an online store's profit on one sale from price, unit cost, shipping, fees and ad spend: profit, margin, the most an ad can cost a sale, and break-even return on ad spend. Arithmetic on the numbers given, in any currency.

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": {
      "price": "<price>",
      "unitCost": "<unitCost>"
    },
    "name": "calculate_profit_per_sale"
  }
}

Input Schema

NameRequiredDescriptionDefault
priceYesWhat the shopper pays for one unit.
adCostNoWhat the store spends on ads to win one sale. 0 for none.
feePctNoPayment and marketplace fees as a percentage of the price, e.g. 2.9.
shippingNoWhat sending one order to the shopper costs the store. 0 if the shopper pays it.
unitCostYesWhat one unit costs the store, delivered to it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavioral facts: the result is pure arithmetic on the supplied numbers, no external data is fetched, and values are currency-agnostic as long as units are consistent.

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?

A single sentence, front-loaded with the verb and resource, then the inputs, then the outputs. No filler, no repetition of annotation or schema content.

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?

With no output schema, the description carries the burden of describing return values and does so by enumerating all four computed figures. Inputs, computation nature, and unit/currency handling are all covered for a five-parameter calculator.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds interpretive meaning by naming the five cost components together and framing them as one coherent model of a sale. The 'any currency' note clarifies that parameters must share a unit, which the schema does not state.

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 gives a precise verb ('works out') plus the exact resource ('profit on one sale') and enumerates the computed outputs (profit, margin, max ad cost, break-even ROAS). That is enough to distinguish it from siblings like apply_pricing_rule or estimate_price_change, though it never explicitly contrasts itself with them.

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: 'Arithmetic on the numbers given, in any currency' signals a pure calculator with no lookups or currency conversion, which is useful context. There is no explicit when-to-use statement, no prerequisite conditions, and no routing advice toward or away from the pricing siblings.

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