Calculate precise macronutrient targets (protein, carbs, fats) based on body stats, activity level, and goals. Use via MCP in Cursor or Windsurf for nutrition planning, or call GET /v1/health/macros directly. Returns grams and calories for each macro, plus total daily energy expenditure. Essential for fitness apps and meal planning tools.
curl "https://tinyfn.io/v1/health/macros" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/health/macros', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/health/macros',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's health tools:
{
"mcpServers": {
"tinyfn-health": {
"url": "https://tinyfn.io/mcp/health",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Specify your goal in the request - weight loss typically uses a caloric deficit with higher protein ratios, while muscle gain uses a surplus with balanced macros. The tool adjusts ratios accordingly.
You need weight, height, age, biological sex, and activity level. The tool uses established formulas like Harris-Benedict or Mifflin-St Jeor to calculate basal metabolic rate first.
Yes, agents in Cursor or Cline can calculate macro targets, then use other nutrition tools to build meal plans that hit those exact protein, carb, and fat goals.
Absolutely. It multiplies your BMR by activity factors ranging from sedentary (1.2) to very active (1.9) to determine total daily energy expenditure and macro needs.
The response shows both - grams are what you actually eat, calories show energy contribution. Protein and carbs provide 4 cal/gram, fats provide 9 cal/gram.
Get your free API key and start using Calculate Macros in seconds.
Get Free API Key