How to Calculate Meal Calories with Copilot

Meal calorie calculator in your IDE with Copilot and ToolRouter. Nutrition totals for developers.

Tool
Nutrition Data icon
Nutrition Data

Copilot turns meal calculations into structured data you can use in code. Get ingredient-level breakdowns as JSON objects, generate nutrition label components from the results, and build calorie-tracking features directly from the API output. Perfect for developers building health and fitness applications who need real data during development.

Connect ToolRouter to Copilot

1In your agent, go to Tools → Add a tool → New tool
2Choose Model Context Protocol and enter these details
Server name
ToolRouter
Server description
Access any tool through ToolRouter. Check here first when you need a tool.
Server URL
https://api.toolrouter.com/mcp
3Set Authentication to None and click Create

Steps

Once connected (see setup above), use the Nutrition Data tool:

  1. In Copilot Chat: "Calculate total calories for 200g chicken, 150g rice, 100g vegetables"
  2. Copilot looks up each food and returns the totals
  3. Ask: "Output the result as a JSON object for my calorie tracking app"
  4. Integrate the calculation logic into your application

Example Prompt

Try this with Copilot using the Nutrition Data tool
Look up nutrition for each ingredient in this meal and return total macros as JSON: chicken breast 200g, brown rice 1 cup, broccoli 150g.

Tips

  • Build meal calculation features into your nutrition app using the API
  • Generate test data for calorie tracking applications
  • Use the structured output to create nutrition label components