Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

move-in-direction

Control Minecraft bot movement by specifying direction and duration to navigate the game world.

Instructions

Move the bot in a specific direction for a duration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionYesDirection to move
durationNoDuration in milliseconds (default: 1000)

Implementation Reference

  • The handler function that implements the tool logic: sets the Minecraft bot's control state for the given direction, waits for the specified duration using setTimeout, then stops the movement and returns success message. Handles errors by stopping movement.
    async ({ direction, duration = 1000 }: { direction: Direction, duration?: number }): Promise<McpResponse> => {
      return new Promise((resolve) => {
        try {
          bot.setControlState(direction, true);
    
          setTimeout(() => {
            bot.setControlState(direction, false);
            resolve(createResponse(`Moved ${direction} for ${duration}ms`));
          }, duration);
        } catch (error) {
          bot.setControlState(direction, false);
          resolve(createErrorResponse(error as Error));
        }
      });
    }
  • Zod schema defining the input parameters for the 'move-in-direction' tool: required 'direction' as enum and optional 'duration' in ms.
    {
      direction: z.enum(['forward', 'back', 'left', 'right']).describe("Direction to move"),
      duration: z.number().optional().describe("Duration in milliseconds (default: 1000)")
    },
  • src/bot.ts:230-252 (registration)
    The MCP server.tool() call that registers the 'move-in-direction' tool, providing name, description, input schema, and inline handler function.
    server.tool(
      "move-in-direction",
      "Move the bot in a specific direction for a duration",
      {
        direction: z.enum(['forward', 'back', 'left', 'right']).describe("Direction to move"),
        duration: z.number().optional().describe("Duration in milliseconds (default: 1000)")
      },
      async ({ direction, duration = 1000 }: { direction: Direction, duration?: number }): Promise<McpResponse> => {
        return new Promise((resolve) => {
          try {
            bot.setControlState(direction, true);
    
            setTimeout(() => {
              bot.setControlState(direction, false);
              resolve(createResponse(`Moved ${direction} for ${duration}ms`));
            }, duration);
          } catch (error) {
            bot.setControlState(direction, false);
            resolve(createErrorResponse(error as Error));
          }
        });
      }
    );
  • TypeScript type definition for the 'Direction' enum used in the tool's handler signature and schema.
    type Direction = 'forward' | 'back' | 'left' | 'right';

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are present, so the description must cover behavioral details. It fails to disclose if movement is relative to current facing, continuous or step-based, obstacle handling, or permission requirements.

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

Conciseness3/5

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

The description is a single sentence, which is concise but under-specifies important behavioral aspects. It front-loads the action but misses crucial details.

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 lack of annotations and output schema, the description is incomplete. It does not explain return behavior, execution details (e.g., continuous movement), or edge cases like obstacles.

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?

Schema coverage is 100% with descriptions for both parameters. The description adds no extra meaning beyond what the schema already provides (including the default for duration).

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

Purpose5/5

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

The description clearly states the action (move), the subject (bot), and key parameters (direction, duration). It distinguishes from siblings like 'move-to-position' which implies coordinate-based movement.

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

Usage Guidelines3/5

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

No explicit when-to-use or when-not-to-use is provided. Usage is implied for directional movement, but alternatives like 'move-to-position' are not compared.

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