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 Calculator
  • GET https://hearthpetenergy.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.

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.

Inputs of Dog and Cat Food Calculator
FieldTypeDefaultDescription
speciesselect (dog, cat)"dog"Animal
weightKgnumber20Body weight (kg). For weight loss enter the target weight your vet suggests.
stageselect (neutered, intact, inactive, weight-loss, growth-young, growth-older, gestation, lactation, custom)"neutered"Life stage
factornumber0My vet’s factor (× RER, only for “My vet’s factor”)
foodKcalPerKgnumber3600Food energy (kcal per kg, from the label). Often printed as “metabolisable energy”; 0 = not known.
foodKcalPerCupnumber0Food energy (kcal per cup, optional)
treatKcalnumber0Treats per day (kcal)
mealsinteger2Meals 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" }
  }
}