API & MCP
Everything a person can do on Repair or Replace, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://repairorreplace.usefulweb.site/api/v1/calculate– run Repair or ReplaceGET https://repairorreplace.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Repair or Replace
Enter the age and expected lifespan of a broken item, the repair quote, the replacement price and running costs. The tool applies the common 50% rule of thumb and compares the cost per remaining year of repairing versus replacing, including the risk of another failure, and gives a reasoned verdict.
| Field | Type | Default | Description |
|---|---|---|---|
itemName | text | "Appliance" | Item |
currency | text | "EUR" | Currency. Shown in results only; no conversion is performed. |
itemAgeYears | number | 6 | Age of the item |
expectedLifespanYears | number | 10 | Typical lifespan. Typical total life of this kind of item; also used for the new one unless set below. |
replacementPrice (required) | number | 600 | Price of a new replacement |
repairQuote (required) | number | 200 | Repair quote |
lifeAfterRepairYears | number | 3 | Expected extra life after repair |
newItemLifespanYears | number | — | Lifespan of the new item (optional) |
runningCostOldPerYear | number | 0 | Running cost of the old item. Energy, water, consumables. |
runningCostNewPerYear | number | 0 | Running cost of the new item |
failureProbabilityPercent | number | 30 | Chance of another failure after repair. Your estimate for the extra life period; an assumption, not a statistic. |
nextRepairCost | number | — | Cost of that next repair (optional). Defaults to the current repair quote. |
ruleThresholdPercent | number | 50 | Rule-of-thumb threshold |
Example request
Washing machine with a failed drum bearing
curl -X POST https://repairorreplace.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"itemName":"Washing machine","currency":"EUR","itemAgeYears":8,"expectedLifespanYears":11,"replacementPrice":550,"repairQuote":320,"lifeAfterRepairYears":3,"runningCostOldPerYear":75,"runningCostNewPerYear":55,"failureProbabilityPercent":35,"ruleThresholdPercent":50}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://repairorreplace.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
repair_or_replace - Local stdio connector:
node src/mcp-stdio.ts --tool=repair-or-replace
{
"mcpServers": {
"repair-or-replace": { "type": "http", "url": "https://repairorreplace.usefulweb.site/mcp" }
}
}