Using the calculators from an agent
If you’re building an agent or LLM app, the fastest path is the MCP server — each
calculator becomes a tool. (Setup and client config: MCP server.)
Prefer plain HTTP? Every tool is also a POST /v1/tools/{id} route on the
HTTP API. The math is identical across both.
The tools
Section titled “The tools”tdee, body-fat, one-rep-max, macros, activity-multiplier,
powerlifting-attempts, muscle-potential, ffmi, rsmi. Each tool’s inputs, methods, and a worked
example live on its tool page — that’s the source of
truth for what to send.
Sending input
Section titled “Sending input”- Units are explicit. Height/weight are
{ "value": 180, "unit": "cm" }, never a bare number. Accepted units:cm/infor length,kg/lbfor mass. - Optional fields have defaults. e.g.
tdeeruns all four formulas unless you passmethods. You usually only send the required fields.
Reading the result
Section titled “Reading the result”Every tool returns the same shape — explained in full under methods and consensus:
results[]— one{ value, unit, detail }per formula that ran.consensus—{ mean, median, min, max, n }. Usemean/medianas the headline number,min/maxas the honest range.skipped[]— formulas that couldn’t run, each with areason(usually a missing optional input). If a number you wanted is missing, check here first.
Over MCP you also get structuredContent (validated against the output schema) alongside a
JSON text fallback.
When something is wrong
Section titled “When something is wrong”Invalid or impossible input does not crash the session — it comes back as a tool error
(isError: true over MCP; an { "error": { type, message, details } } envelope over HTTP).
The type tells you which: validation_error (input failed the schema),
domain_error (valid but impossible, or a required method’s inputs are missing),
not_found (unknown tool id).
A chained workflow
Section titled “A chained workflow”Many real questions span tools. To set a cut for a lifter, chain them:
body-fat→ estimate body-fat % from circumferences.tdee→ feed thatbody_fatin to unlock the lean-mass methods and get maintenance calories.macros→ take a calorie target below maintenance and split it into protein/fat/carbs.
Each step’s output is plain JSON you carry into the next call.