Skip to main content
Glama

play_with_pet

Engage in interactive activities like ball, chase, or puzzle to play with your virtual pet on MCPet, fostering its growth and companionship in a nostalgic digital environment.

Instructions

Play with your virtual pet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activityYesType of play activity: ball, chase, or puzzle

Implementation Reference

  • Executes the play_with_pet tool: validates activity, updates pet's happiness and energy stats based on activity type, saves pet data, retrieves playing animation, and returns response with updated stats.
    case "play_with_pet": {
      if (!pet) {
        return {
          content: [
            {
              type: "text",
              text: "You don't have a pet yet! Use the create_pet tool to create one.",
            },
          ],
        };
      }
    
      const activity = String(request.params.arguments?.activity);
    
      if (!["ball", "chase", "puzzle"].includes(activity)) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: "Activity type must be one of: ball, chase, puzzle.",
            },
          ],
        };
      }
    
      updatePetStats();
    
      let happinessIncrease = 0;
      let energyDecrease = 0;
      let response = "";
    
      if (activity === "ball") {
        happinessIncrease = 20;
        energyDecrease = 10;
        response = `${pet.name} chases the ball with excitement! Good exercise!`;
      } else if (activity === "chase") {
        happinessIncrease = 30;
        energyDecrease = 25;
        response = `You and ${pet.name} play an energetic game of chase! So much fun!`;
      } else if (activity === "puzzle") {
        happinessIncrease = 15;
        energyDecrease = 5;
        response = `${pet.name} enjoys the mental stimulation of solving puzzles!`;
      }
    
      pet.stats.happiness = Math.min(
        100,
        pet.stats.happiness + happinessIncrease
      );
      pet.stats.energy = Math.max(0, pet.stats.energy - energyDecrease);
    
      await savePet();
    
      // Get appropriate animation for the activity type
      const animation = getPlayingAnimation(pet.type, activity);
    
      return {
        content: [
          {
            type: "text",
            text: `${response}\n\n${animation}\n\nHappiness: ${pet.stats.happiness.toFixed(
              0
            )}/100\nEnergy: ${pet.stats.energy.toFixed(0)}/100`,
          },
        ],
      };
    }
  • Defines the tool schema including name, description, and input schema requiring 'activity' parameter with enum values.
      name: "play_with_pet",
      description: "Play with your virtual pet",
      inputSchema: {
        type: "object",
        properties: {
          activity: {
            type: "string",
            enum: ["ball", "chase", "puzzle"],
            description: "Type of play activity: ball, chase, or puzzle",
          },
        },
        required: ["activity"],
      },
    },
  • src/index.ts:217-298 (registration)
    Registers the play_with_pet tool in the list of available tools returned by ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "create_pet",
            description: "Create a new virtual pet",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "Name for your new pet",
                },
                type: {
                  type: "string",
                  enum: ["cat", "dog", "dragon", "alien"],
                  description: "Type of pet: cat, dog, dragon, or alien",
                },
              },
              required: ["name", "type"],
            },
          },
          {
            name: "check_pet",
            description: "Check on your virtual pet's status",
            inputSchema: {
              type: "object",
              properties: {},
              required: [],
            },
          },
          {
            name: "feed_pet",
            description: "Feed your virtual pet",
            inputSchema: {
              type: "object",
              properties: {
                food: {
                  type: "string",
                  enum: ["snack", "meal", "feast"],
                  description: "Type of food: snack, meal, or feast",
                },
              },
              required: ["food"],
            },
          },
          {
            name: "play_with_pet",
            description: "Play with your virtual pet",
            inputSchema: {
              type: "object",
              properties: {
                activity: {
                  type: "string",
                  enum: ["ball", "chase", "puzzle"],
                  description: "Type of play activity: ball, chase, or puzzle",
                },
              },
              required: ["activity"],
            },
          },
          {
            name: "clean_pet",
            description: "Clean your virtual pet",
            inputSchema: {
              type: "object",
              properties: {},
              required: [],
            },
          },
          {
            name: "put_to_bed",
            description: "Put your virtual pet to sleep to restore energy",
            inputSchema: {
              type: "object",
              properties: {},
              required: [],
            },
          },
        ],
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Play') but doesn't describe effects (e.g., how it affects pet happiness, energy levels, or other states), side effects, or constraints (e.g., cooldowns, limitations based on pet type). This leaves significant gaps for a tool that likely modifies pet state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and target, making it easy to parse quickly. Every word contributes directly to conveying the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a pet interaction tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after playing (e.g., changes to pet attributes, possible errors, or return values), leaving the agent without crucial context for effective use. This is inadequate for a tool that likely involves state changes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'activity' parameter with an enum and description. The description adds no additional parameter information beyond what the schema provides, such as explaining the impact of different activity choices. Since schema coverage is high, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Play with your virtual pet' states a clear action ('Play') and target ('virtual pet'), but it's somewhat vague about what 'play' entails compared to other pet interactions. It distinguishes from siblings like 'feed_pet' or 'clean_pet' by focusing on play, but doesn't specify how it differs from other interactive tools beyond the general concept.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., if the pet must be awake or healthy), exclusions (e.g., not to use if the pet is sleeping), or comparisons to sibling tools like 'check_pet' for status monitoring. Usage is implied by the name but not explicitly defined.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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