Skip to main content
Glama

moveTo

Teleport a Minecraft player to specified X, Y, Z coordinates. Use precise location control for navigation and building tasks.

Instructions

Move the player to a specific location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • The handler function for the 'moveTo' tool. Registers tool with name 'moveTo', defines Zod schema for x/y/z coordinates, and implements logic using mineflayer-pathfinder (Movements, GoalBlock, pathfinder.goto) with a 60-second timeout.
    server.tool(
      'moveTo',
      'Move the player to a specific location',
      {
        x: z.number().describe('X coordinate'),
        y: z.number().describe('Y coordinate'),
        z: z.number().describe('Z coordinate'),
      },
      async ({ x, y, z }) => {
        if (!botState.isConnected || !botState.bot) {
          return createNotConnectedResponse()
        }
    
        try {
          // Set pathfinder Movements
          const movements = new Movements(botState.bot)
          botState.bot.pathfinder.setMovements(movements)
    
          // Set target position
          const goal = new goals.GoalBlock(x, y, z)
    
          return new Promise<ToolResponse>((resolve) => {
            // Start movement
            botState
              .bot!.pathfinder.goto(goal)
              .then(() => {
                resolve(
                  createSuccessResponse(
                    `Successfully moved to X=${x}, Y=${y}, Z=${z}`
                  )
                )
              })
              .catch((err) => {
                resolve(createErrorResponse(err))
              })
    
            // Timeout handling (if still moving after 1 minute)
            setTimeout(() => {
              resolve(
                createSuccessResponse(
                  'Movement is taking longer than expected. Still trying to reach the destination...'
                )
              )
            }, 60000)
          })
        } catch (error) {
          return createErrorResponse(error)
        }
      }
    )
  • Input schema for the 'moveTo' tool using Zod: x (number), y (number), z (number) coordinate descriptions.
    {
      x: z.number().describe('X coordinate'),
      y: z.number().describe('Y coordinate'),
      z: z.number().describe('Z coordinate'),
    },
  • Registration call: registerMovementTools() is invoked from registerAllTools() to register the 'moveTo' tool on the MCP server.
    registerMovementTools()
  • The registerMovementTools() export function that calls server.tool('moveTo', ...) to register the tool.
    export function registerMovementTools() {
      // Tool to get current position information
      server.tool(
        'getPosition',
        'Get the current position of the player in the Minecraft world',
        {},
        async () => {
          if (!botState.isConnected || !botState.bot) {
            return createNotConnectedResponse()
          }
    
          try {
            const position = botState.bot.entity.position
            return createSuccessResponse(
              `Current position: X=${position.x.toFixed(2)}, Y=${position.y.toFixed(
                2
              )}, Z=${position.z.toFixed(2)}`
            )
          } catch (error) {
            return createErrorResponse(error)
          }
        }
      )
    
      // Tool to move to a specified location
      server.tool(
        'moveTo',
        'Move the player to a specific location',
        {
          x: z.number().describe('X coordinate'),
          y: z.number().describe('Y coordinate'),
          z: z.number().describe('Z coordinate'),
        },
        async ({ x, y, z }) => {
          if (!botState.isConnected || !botState.bot) {
            return createNotConnectedResponse()
          }
    
          try {
            // Set pathfinder Movements
            const movements = new Movements(botState.bot)
            botState.bot.pathfinder.setMovements(movements)
    
            // Set target position
            const goal = new goals.GoalBlock(x, y, z)
    
            return new Promise<ToolResponse>((resolve) => {
              // Start movement
              botState
                .bot!.pathfinder.goto(goal)
                .then(() => {
                  resolve(
                    createSuccessResponse(
                      `Successfully moved to X=${x}, Y=${y}, Z=${z}`
                    )
                  )
                })
                .catch((err) => {
                  resolve(createErrorResponse(err))
                })
    
              // Timeout handling (if still moving after 1 minute)
              setTimeout(() => {
                resolve(
                  createSuccessResponse(
                    'Movement is taking longer than expected. Still trying to reach the destination...'
                  )
                )
              }, 60000)
            })
          } catch (error) {
            return createErrorResponse(error)
          }
        }
      )
    }
Behavior2/5

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

With no annotations, the description must disclose behavior. It omits whether movement is instant, respects obstacles, or has side effects. Lacks details on disallowed locations or return values.

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?

Single sentence with no extraneous information. Perfectly concise.

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?

For a tool with no output schema and no annotations, the description is too brief. Missing details on movement type, boundary checks, and expected behavior when coordinates are invalid.

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 covers all three parameters (x, y, z) with full description. The description adds little beyond 'specific location', providing no extra nuance beyond the schema.

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 explicitly states the verb 'Move' and the resource 'the player to a specific location', clearly distinguishing it from siblings like 'moveControl' or 'getPosition'.

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?

No guidance on when to use this tool versus alternatives (e.g., 'moveControl' for continuous movement). The description provides no context about prerequisites or scenarios.

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

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/nacal/mcp-minecraft-remote'

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