API & MCP

Everything a person can do on Pet Age in Human Years, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

  • POST https://hearthpetage.usefulweb.site/api/v1/calculate – run Pet Age in Human Years
  • GET https://hearthpetage.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.

Pet Age in Human Years

Converts a dog’s age with the AVMA chart for its size group and the DNA-methylation formula of Wang et al. (2020), and a cat’s age with the International Cat Care chart and life stage. Every number is an estimate that helps you think about life stages, not a medical age.

Inputs of Pet Age in Human Years
FieldTypeDefaultDescription
speciesselect (dog, cat)"dog"Animal
ageYearsnumber5Age (years, decimals allowed)
sizeselect (auto, small, medium, large, giant)"auto"Dog size group
weightKgnumber20Adult weight (kg, for “from the adult weight”)

Example request

Five-year-old 20 kg dog

curl -X POST https://hearthpetage.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"species":"dog","ageYears":5,"size":"auto","weightKg":20}'

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