put_to_bed
Restore your virtual pet's energy by putting it to sleep. This tool helps ensure your digital companion stays healthy and thrives in the MCPet server's nurturing environment.
Instructions
Put your virtual pet to sleep to restore energy
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/index.ts:604-639 (handler)The handler logic for the 'put_to_bed' tool. It checks if a pet exists, updates stats, fully restores energy to 100, increases health by up to 10, saves the pet data, retrieves a sleeping animation, and returns a response with the animation and updated stats.case "put_to_bed": { if (!pet) { return { content: [ { type: "text", text: "You don't have a pet yet! Use the create_pet tool to create one.", }, ], }; } updatePetStats(); // Sleeping fully restores energy and improves health pet.stats.energy = 100; pet.stats.health = Math.min(100, pet.stats.health + 10); await savePet(); // Get the sleeping animation const animation = getSleepingAnimation(pet.type); return { content: [ { type: "text", text: `${ pet.name } gets a good night's sleep and wakes up refreshed!\n\n${animation}\n\nEnergy: ${pet.stats.energy.toFixed( 0 )}/100\nHealth: ${pet.stats.health.toFixed(0)}/100`, }, ], }; }
- src/index.ts:287-295 (registration)Registration of the 'put_to_bed' tool in the ListToolsRequestSchema handler, including the tool name, description, and input schema (no required parameters).{ name: "put_to_bed", description: "Put your virtual pet to sleep to restore energy", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/index.ts:290-294 (schema)Input schema for the 'put_to_bed' tool, which requires no parameters.inputSchema: { type: "object", properties: {}, required: [], },