Skip to main content
Glama
Dinesh-Satram

Health & Fitness Coach MCP

plan-generator.ts1.37 kB
import { z } from "zod"; import { memoryStore } from "../utils/memoryStore"; import { generatePlan } from "../utils/llmClient"; export const planGeneratorTool = { name: "generate-plan", description: "Generate a personalized weekly fitness and nutrition plan based on user's activity history", schema: { userId: z.string().describe("Unique user identifier"), }, handler: async ({ userId }: { userId: string }) => { try { // Get user's complete context const context = memoryStore.getContext(userId); // Generate personalized plan using LLM const plan = await generatePlan(context); return { content: [ { type: "text" as const, text: `🎯 **Your Personalized Fitness Plan** ${plan.text} --- *This plan is based on your recent activity data. Remember to listen to your body and adjust as needed. Log your workouts and meals to get even better recommendations!*`, }, ], }; } catch (error) { console.error('Error generating plan:', error); return { content: [ { type: "text" as const, text: `❌ Error generating plan: ${error instanceof Error ? error.message : 'Unknown error'} Please try again later or contact support if the issue persists.`, }, ], }; } }, };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dinesh-Satram/fitness_coach_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server