API & MCP

Everything a person can do on Favorlane Favour Balance, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

  • POST https://favorlanefavourbalance.usefulweb.site/api/v1/calculate – run Favorlane Favour Balance
  • GET https://favorlanefavourbalance.usefulweb.site/api/v1/tool – inputs, output schema, examples
  • OpenAPI 3.1: /openapi.json · /openapi.yaml
  • Errors: application/problem+json; 422 includes per-field errors.

Favorlane Favour Balance

Adds up a list of favours (who helped whom, in hours, points or simply favours) like a time bank: what each person gave and received, the balance between every pair, and the shortest list of favours to return so that everyone is even. Deterministic and exact to two decimals.

Inputs of Favorlane Favour Balance
FieldTypeDefaultDescription
exchangestextarea"Ana -> Ben 2 (carried boxes)\nBen -> Ana 1 (fixed the laptop)\nCleo -> Ana 3 (bFavours (one per line: helper -> helped amount). For example “Ana -> Ben 2 (carried boxes)” = Ana helped Ben for 2 hours. Without an amount a line counts 1. CSV with from,to,amount works too.
unitselect (hours, points, favours)"hours"Amounts are

Example request

Neighbours swapping help

curl -X POST https://favorlanefavourbalance.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"exchanges":"Ana -> Ben 2 (carried boxes)\nBen -> Ana 1 (fixed the laptop)\nCleo -> Ana 3 (babysitting)\nAna -> Dev 1.5 (garden)\nDev -> Cleo 1 (marmalade swap)","unit":"hours"}'

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://favorlanefavourbalance.usefulweb.site/mcp – protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake).
  • Tools: favorlane_favour_balance
  • Local stdio connector: node src/mcp-stdio.ts --tool=favorlane-favour-balance
{
  "mcpServers": {
    "favorlane-favour-balance": { "type": "http", "url": "https://favorlanefavourbalance.usefulweb.site/mcp" }
  }
}