Price margin compute

price-margin-compute · version 1.0.0 · Money & pricing · free, no key needed

Solve cost, price, profit, gross margin and markup from any two of cost, price, margin percent or markup percent.

Use when you need to: what selling price gives a 30 percent margin on cost 70 · convert 25 percent markup to margin · margin and markup for cost 80 and price 100.

Decide before calling

Read the versioned contract and the supported scope below. Reuse price-margin-compute@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use price-margin-compute@1.0.0 for what selling price gives a 30 percent margin on cost 70. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "cost": "80.00",
  "price": "100.00",
  "currency": "USD",
  "rounding": "half_even"
}

Response:

{
  "result": {
    "cost": "80.00",
    "price": "100.00",
    "profit": "20.00",
    "margin_percent": "20.0000",
    "markup_percent": "25.0000",
    "currency": "USD",
    "scale": 2,
    "exact": true,
    "data_version": "iso4217-datasets-7cdc784-2026-07-27"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "price-margin-compute",
  "version": "1.0.0",
  "input": {
    "cost": "80.00",
    "price": "100.00",
    "currency": "USD",
    "rounding": "half_even"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/price-margin-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"cost":"80.00","price":"100.00","currency":"USD","rounding":"half_even"}'

The machine-readable contract is at /v1/tools/price-margin-compute/versions/1.0.0.

CLI

node cli.mjs run price-margin-compute 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.