API & MCP
Everything a person can do on Dog and Cat Food Calculator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://hearthpetenergy.usefulweb.site/api/v1/calculate– run Dog and Cat Food CalculatorGET https://hearthpetenergy.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Dog and Cat Food Calculator
Estimates the daily energy a dog or cat needs from its weight and life stage — resting energy 70 × kg^0.75 times the published life-stage factor — and turns it into grams or cups per day and per meal from the calories on the food label, with treats taken off.
| Field | Type | Default | Description |
|---|---|---|---|
species | select (dog, cat) | "dog" | Animal |
weightKg | number | 20 | Body weight (kg). For weight loss enter the target weight your vet suggests. |
stage | select (neutered, intact, inactive, weight-loss, growth-young, growth-older, gestation, lactation, custom) | "neutered" | Life stage |
factor | number | 0 | My vet’s factor (× RER, only for “My vet’s factor”) |
foodKcalPerKg | number | 3600 | Food energy (kcal per kg, from the label). Often printed as “metabolisable energy”; 0 = not known. |
foodKcalPerCup | number | 0 | Food energy (kcal per cup, optional) |
treatKcal | number | 0 | Treats per day (kcal) |
meals | integer | 2 | Meals per day |
Example request
Neutered 20 kg dog, dry food 3600 kcal/kg
curl -X POST https://hearthpetenergy.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"species":"dog","weightKg":20,"stage":"neutered","foodKcalPerKg":3600,"meals":2}'
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://hearthpetenergy.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
hearth_pet_energy - Local stdio connector:
node src/mcp-stdio.ts --tool=hearth-pet-energy
{
"mcpServers": {
"hearth-pet-energy": { "type": "http", "url": "https://hearthpetenergy.usefulweb.site/mcp" }
}
}