Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix D: Natural Language to Tool Mapping

Quick reference mapping natural language prompts to Pierre MCP tools.

Supported Providers

Pierre supports 6 fitness providers: strava, garmin, fitbit, whoop, terra, coros

All provider-specific tools accept any of these providers in the provider parameter.

Connection & Authentication

User says…ToolParameters
“Link my Strava account”connect_provider{"provider": "strava"}
“Connect my Garmin watch”connect_provider{"provider": "garmin"}
“Show my connections”get_connection_statusNone
“Disconnect from Fitbit”disconnect_provider{"provider": "fitbit"}

Data Access

User says…ToolParameters
“Show my last 10 runs”get_activities{"provider": "strava", "limit": 10}
“Get my WHOOP workouts”get_activities{"provider": "whoop", "limit": 10}
“Get my Strava profile”get_athlete{"provider": "strava"}
“What are my year-to-date stats?”get_stats{"provider": "strava"}
“Show my Terra data”get_activities{"provider": "terra", "limit": 10}
“Analyze activity 12345”get_activity_intelligence{"activity_id": "12345", "provider": "garmin"}

Performance Analysis

User says…ToolParameters
“Analyze my last workout”analyze_activityActivity data
“Am I getting faster?”analyze_performance_trendsHistorical activities
“Compare my last two rides”compare_activitiesTwo activity IDs
“Find patterns in my training”detect_patternsActivities array
“What’s my current fitness level?”calculate_fitness_scoreActivities + user profile
“Predict my marathon time”predict_performanceCurrent fitness + race details

Goals

User says…ToolParameters
“Set a goal to run sub-20 5K”set_goal{"type": "5K", "target_time": "00:20:00"}
“How am I progressing?”track_progressGoal ID
“Suggest realistic goals”suggest_goalsCurrent fitness level
“Can I run a 3-hour marathon?”analyze_goal_feasibility{"goal_type": "marathon", "target_time": "03:00:00"}

Training Recommendations

User says…ToolParameters
“What should I work on?”generate_recommendationsPerformance analysis
“Am I overtraining?”analyze_training_loadRecent activities
“Do I need a rest day?”suggest_rest_dayRecovery metrics

Nutrition

User says…ToolParameters
“How many calories should I eat?”calculate_daily_nutritionUser profile + activity level
“Search for banana nutrition”search_food{"query": "banana"}
“Show food details for ID 123”get_food_details{"fdc_id": "123"}
“Analyze this meal”analyze_meal_nutritionArray of foods with portions
“When should I eat carbs?”get_nutrient_timingTraining schedule

Sleep & Recovery

User says…ToolParameters
“How was my sleep?”analyze_sleep_qualitySleep session data
“What’s my recovery score?”calculate_recovery_scoreMulti-factor recovery data
“Optimize my sleep schedule”optimize_sleep_scheduleSleep history
“Track my sleep trends”track_sleep_trendsSleep sessions over time

Configuration

User says…ToolParameters
“Update my FTP to 250W”update_user_configuration{"ftp": 250}
“Calculate my heart rate zones”calculate_personalized_zonesUser profile
“Show my configuration”get_user_configurationNone
“What configuration profiles exist?”get_configuration_catalogNone
“Set my fitness config”set_fitness_configConfig key + value
“Show my fitness settings”get_fitness_configConfig key

Recipe Management (“Combat des Chefs”)

Pierre includes a training-aware recipe management system that aligns meal planning with training phases.

User says…ToolParameters
“What macros should I target for lunch?”get_recipe_constraints{"meal_timing": "pre_training"}
“Validate this chicken recipe”validate_recipeRecipe with ingredients array
“Save this recipe to my collection”save_recipeValidated recipe data
“Show my saved recipes”list_recipes{"meal_timing": "post_training"}
“Get recipe details for ID 123”get_recipe{"recipe_id": "123"}
“Delete this recipe”delete_recipe{"recipe_id": "123"}
“Search for pasta recipes”search_recipes{"query": "pasta", "meal_timing": "pre_training"}

Recipe Workflow Pattern:

1. get_recipe_constraints → Get macro targets for training phase
2. LLM generates recipe matching constraints
3. validate_recipe → Check nutrition against USDA database
4. save_recipe → Store validated recipe
5. list_recipes/search_recipes → Browse collection

Prompt Patterns

Pattern 1: Temporal queries

  • “my last X…” → limit: X, offset: 0
  • “this week…” → Filter by start_date >= week_start
  • “in the past month…” → Filter by date range

Pattern 2: Comparative queries

  • “compare A and B” → compare_activities with two IDs
  • “better than…” → Fetch both, compare metrics

Pattern 3: Trend queries

  • “am I improving?” → analyze_performance_trends
  • “getting faster/slower?” → Trend analysis with slope

Pattern 4: Predictive queries

  • “can I…?” → analyze_goal_feasibility
  • “what if…?” → predict_performance with scenarios

Key Takeaways

  1. Natural language: AI assistants map user prompts to tool calls automatically.
  2. Temporal context: “last 10”, “this week”, “past month” determine filters.
  3. Implicit parameters: Provider (strava, garmin, fitbit, whoop, terra) often inferred from context or connection status.
  4. Tool chaining: Complex queries combine multiple tools sequentially.
  5. Context awareness: AI remembers previous queries for follow-up questions.
  6. Multi-provider: Users can connect multiple providers and query them independently.

End of Tutorial

You’ve completed the comprehensive Pierre Fitness Platform tutorial! You now understand:

  • Part I: Foundation (architecture, errors, config, DI)
  • Part II: Authentication & Security (cryptography, JWT, multi-tenancy, middleware)
  • Part III: MCP Protocol (JSON-RPC, request flow, transports, tool registry)
  • Part IV: SDK & Type System (bridge architecture, type generation)
  • Part V: OAuth, A2A & Providers (OAuth server/client, provider abstraction, A2A protocol)
  • Part VI: Tools & Intelligence (47 tools, sports science algorithms, recovery, nutrition)
  • Part VII: Testing & Deployment (synthetic data, design system, production deployment)

Next Steps:

  1. Review CLAUDE.md for code standards
  2. Explore the codebase using Appendix C as a map
  3. Run the test suite to see synthetic data in action
  4. Set up local development environment
  5. Contribute improvements or new features

Happy coding! 🚀