Skip to main content
Glama
leo4life2

Minecraft MCP Server

by leo4life2

rest

Regain health in Minecraft by resting for a specified time (default: 10 seconds). Use this tool as part of the MCP Server to enable AI agents to manage character recovery during gameplay.

Instructions

Rest to regain health

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
restTimeNoTime to rest in seconds (default: 10)

Implementation Reference

  • The main handler function that executes the 'rest' tool logic: validates parameters, waits for a configurable duration in ticks (simulating rest), handles interruptions, and emits observations.
    export const rest = async (
      bot: Bot,
      params: ISkillParams,
      serviceParams: ISkillServiceParams,
    ): Promise<boolean> => {
      const skillName = 'rest';
      const requiredParams: string[] = [];
      const isParamsValid = validateSkillParams(
        params,
        requiredParams,
        skillName,
      );
      if (!isParamsValid) {
        serviceParams.cancelExecution?.();
        bot.emit(
          'alteraBotEndObservation',
          `Mistake: You didn't provide all of the required parameters ${requiredParams.join(', ')} for the ${skillName} skill.`,
        );
        return false;
      }
    
      const unpackedParams = {
        restTime: params.restTime ?? 4,
        signal: serviceParams.signal,
      };
      let {restTime, signal} = unpackedParams;
      const SECONDS_TO_TICKS = 20; // twenty ticks per second
      restTime = Math.min(restTime, 12); // Set max rest time to 12 seconds.
      const ticks_to_rest = restTime * SECONDS_TO_TICKS; // convert seconds to ticks
      const tick_interval = SECONDS_TO_TICKS * 2; // allow interrupting every 2 seconds
      let cur_sleep_ticks = 0;
    
      while (cur_sleep_ticks < ticks_to_rest) {
        if (isSignalAborted(signal)) {
          // You interrupted your own rest
          return bot.emit(
            'alteraBotEndObservation',
            `You decided to do something else instead of resting.`,
          );
        }
        await bot.waitForTicks(tick_interval);
        cur_sleep_ticks += tick_interval;
      }
      return bot.emit('alteraBotEndObservation', `You finished resting.`);
    };
  • Schema definition for the 'rest' tool, specifying the input parameters (restTime), description, and required fields (none).
    rest: {
        description: "Rest to regain health",
        params: {
            restTime: { type: "number", description: "Time to rest in seconds (default: 10)" }
        },
        required: []
    },
  • Function that registers all skills including 'rest' by iterating over SKILL_METADATA, creating SkillDefinition objects with schema and dynamic executor loader.
    export async function loadSkills(): Promise<SkillDefinition[]> {
        const skills: SkillDefinition[] = [];
    
        for (const [skillName, metadata] of Object.entries(SKILL_METADATA)) {
            skills.push({
                name: skillName,
                description: metadata.description,
                inputSchema: {
                    type: "object",
                    properties: metadata.params,
                    required: metadata.required
                },
                execute: createSkillExecutor(skillName)
            });
        }
    
        return skills;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'regain health' but doesn't disclose behavioral traits such as whether this consumes resources, has cooldowns, requires specific conditions (e.g., safe location), or what happens if interrupted. For a health-restoration tool with zero annotation coverage, this leaves critical gaps in understanding its operation.

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 extremely concise ('Rest to regain health')—just four words that directly state the action and outcome. It's front-loaded with no wasted words, making it easy for an agent to parse quickly. Every element earns its place by conveying core functionality.

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 no annotations, no output schema, and a health-related action, the description is incomplete. It doesn't explain how much health is regained, any dependencies or side effects, or what the tool returns (e.g., success/failure, health amount). For a tool in a game-like context with many siblings, more detail is needed to use it effectively.

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

Parameters4/5

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

With 1 parameter and 100% schema description coverage, the schema fully documents the 'restTime' parameter. The description adds no parameter-specific information beyond implying health restoration, which is appropriate given the high schema coverage. The baseline for 0 parameters would be 4, but with 1 well-documented parameter, this remains adequate.

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 states the purpose ('Rest to regain health') which includes a verb ('rest') and outcome ('regain health'), but it's vague about the mechanism and doesn't differentiate from siblings like 'sleepInNearbyBed' or 'eatFood' which might also restore health. It provides basic functionality but lacks specificity about how this differs from other recovery methods.

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 offers no guidance on when to use this tool versus alternatives. With siblings like 'sleepInNearbyBed', 'eatFood', and 'useItemOnBlockOrEntity' that might also restore health, there's no indication of prerequisites, timing, or comparative effectiveness. The agent must infer usage from context alone.

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/leo4life2/minecraft-mcp-http'

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