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.app/api/v1/calculate– run Pet Age in Human YearsGET https://hearthpetage.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
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.
| Field | Type | Default | Description |
|---|---|---|---|
species | select (dog, cat) | "dog" | Animal |
ageYears | number | 5 | Age (years, decimals allowed) |
size | select (auto, small, medium, large, giant) | "auto" | Dog size group |
weightKg | number | 20 | Adult weight (kg, for “from the adult weight”) |
Example request
Five-year-old 20 kg dog
curl -X POST https://hearthpetage.usefulweb.app/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.app/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.app/mcp" }
}
}