Skip to main content
Glama

check_pet

Monitor your virtual pet's status on MCPet to ensure its well-being and track its evolution based on your care. Stay updated with real-time insights.

Instructions

Check on your virtual pet's status

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • The handler for the 'check_pet' tool. Updates the pet's stats based on time elapsed, loads the idle animation, generates a status description, and returns the current pet status including age.
    case "check_pet": { if (!pet) { return { content: [ { type: "text", text: "You don't have a pet yet! Use the create_pet tool to create one.", }, ], }; } updatePetStats(); await savePet(); // Get the idle animation for status check const animation = getIdleAnimation(pet.type); return { content: [ { type: "text", text: `${animation}\n\n${getStatusDescription()}\n\nAge: ${pet.age.toFixed( 1 )} days`, }, ], }; }
  • src/index.ts:239-247 (registration)
    Registration of the 'check_pet' tool in the ListTools handler, including name, description, and input schema (no required parameters).
    { name: "check_pet", description: "Check on your virtual pet's status", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Helper function getStatusDescription() that generates a detailed text description of the pet's stats for use in the check_pet response.
    function getStatusDescription() { if (!pet) { return "You don't have a pet yet! Create one first."; } const { hunger, happiness, health, energy, cleanliness } = pet.stats; let statusDescription = `${pet.name} is a ${pet.stage} ${pet.type}.\n`; // Add descriptions based on stats if (hunger < 20) { statusDescription += "🍽️ Very hungry! Needs food immediately!\n"; } else if (hunger < 50) { statusDescription += "🍽️ Getting hungry.\n"; } else { statusDescription += "🍽️ Well fed.\n"; } if (happiness < 20) { statusDescription += "😢 Very sad! Needs fun activities!\n"; } else if (happiness < 50) { statusDescription += "😐 Could use some playtime.\n"; } else { statusDescription += "😊 Happy and content.\n"; } if (cleanliness < 20) { statusDescription += "🛁 Very dirty! Needs cleaning!\n"; } else if (cleanliness < 50) { statusDescription += "🛁 Getting dirty.\n"; } else { statusDescription += "✨ Clean and fresh.\n"; } if (energy < 20) { statusDescription += "💤 Exhausted! Needs rest!\n"; } else if (energy < 50) { statusDescription += "💤 Getting tired.\n"; } else { statusDescription += "⚡ Energetic and active.\n"; } if (health < 20) { statusDescription += "🏥 Very sick! Needs medicine and care!\n"; } else if (health < 50) { statusDescription += "🏥 Not feeling well.\n"; } else { statusDescription += "❤️ Healthy.\n"; } return statusDescription; }
  • Helper function updatePetStats() that simulates time passage effects on pet stats, age, and stage, called in check_pet.
    function updatePetStats() { if (!pet) return; // Calculate time passed since last interaction const now = Date.now(); const hoursPassed = (now - pet.lastInteraction) / (1000 * 60 * 60); // Update stats based on time (pets get hungrier, dirtier, and less happy over time) pet.stats.hunger = Math.max(0, pet.stats.hunger - hoursPassed * 5); pet.stats.happiness = Math.max(0, pet.stats.happiness - hoursPassed * 3); pet.stats.cleanliness = Math.max(0, pet.stats.cleanliness - hoursPassed * 4); pet.stats.energy = Math.min(100, pet.stats.energy + hoursPassed * 2); // Gain energy when left alone // Health decreases if hunger or cleanliness is very low if (pet.stats.hunger < 20 || pet.stats.cleanliness < 20) { pet.stats.health = Math.max(0, pet.stats.health - hoursPassed * 2); } // Age increases over time pet.age += hoursPassed / 24; // Age in days // Check for evolution based on age if (pet.age > 10 && pet.stage === "baby") { pet.stage = "child"; } else if (pet.age > 20 && pet.stage === "child") { pet.stage = "teen"; } else if (pet.age > 30 && pet.stage === "teen") { pet.stage = "adult"; } }

Other Tools

Related Tools

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/shreyaskarnik/mcpet'

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