GnistAI GnistAI
Log in

Getting Started with Calories Burned

Calculate caloric expenditure by activity, duration, and body weight using MET values.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Health

Data source: Compendium of Physical Activities

Overview

Calories Burned performs computations on your inputs — no external data source required. This tutorial covers all 5 tools with parameter reference and code examples.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-calories-burned": {
      "url": "https://context.gnist.ai/mcp/calories-burned/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (5)

calculate_calories_burned

Calculate calories burned for a physical activity. Uses MET (Metabolic Equivalent of Task) values from the Compendium of Physical Activities. Formula: calories = MET * 3.5 * weight_kg / 200 * duration_minutes.

ParameterTypeRequiredDescription
activitystringrequiredActivity ID (e.g. running-5mph, cycling-moderate, yoga-hatha).
weight_kgnumberrequiredBody weight in kilograms.
duration_minutesnumberrequiredDuration of activity in minutes.
curl -X POST "https://context.gnist.ai/mcp/calories-burned/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "calculate_calories_burned", "arguments": {"activity": "running-5mph", "weight_kg": 1.0, "duration_minutes": 1.0}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/calories-burned/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'activity': 'running-5mph',
                          'duration_minutes': 1.0,
                          'weight_kg': 1.0},
            'name': 'calculate_calories_burned'}},
)
print(resp.json())

search_activities

Search available physical activities by name or category.

ParameterTypeRequiredDescription
querystringrequiredSearch by activity name or category (e.g. 'running', 'swimming').
limitintegeroptional (default: 20)
curl -X POST "https://context.gnist.ai/mcp/calories-burned/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_activities", "arguments": {"query": "'running'"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/calories-burned/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': "'running'"}, 'name': 'search_activities'}},
)
print(resp.json())

list_activities_by_category

List all activities in a given category.

ParameterTypeRequiredDescription
categorystringrequiredActivity category (e.g. Running, Swimming, Gym, Sports).
curl -X POST "https://context.gnist.ai/mcp/calories-burned/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_activities_by_category", "arguments": {"category": "Running"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/calories-burned/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'category': 'Running'},
            'name': 'list_activities_by_category'}},
)
print(resp.json())

get_activity_categories

List all available activity categories.

curl -X POST "https://context.gnist.ai/mcp/calories-burned/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_activity_categories", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/calories-burned/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'get_activity_categories'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/calories-burned/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/calories-burned/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_activities to find items, then get_activity_categories to get full details. This two-step pattern is common for exploring data before drilling down.
Pagination
Several tools support limit, offset, or page parameters. Start with small limits during development, then increase for production queries.

FAQ

What data does Calories Burned provide?

Calculate caloric expenditure by activity, duration, and body weight using MET values. It exposes 5 tools: calculate_calories_burned, search_activities, list_activities_by_category, get_activity_categories, report_feedback.

Does this toolkit require external data?

No. It performs computations on your inputs directly. You only need a Gnist API key.

What format does the Calories Burned API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials