Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

fly-to

Teleport a Minecraft character to specific coordinates by providing X, Y, and Z values for precise movement within the game world.

Instructions

Make the bot fly to a specific position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • The complete inline handler for the 'fly-to' tool. Checks for creative mode, sets up a timed abortable flight using bot.creative.flyTo via a helper, handles errors and timeouts.
    server.tool(
      "fly-to",
      "Make the bot fly to a specific position",
      {
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        z: z.number().describe("Z coordinate")
      },
      async ({ x, y, z }): Promise<McpResponse> => {
        if (!bot.creative) {
          return createResponse("Creative mode is not available. Cannot fly.");
        }
        
        const currentPos = bot.entity.position;
        console.error(`Flying from (${Math.floor(currentPos.x)}, ${Math.floor(currentPos.y)}, ${Math.floor(currentPos.z)}) to (${Math.floor(x)}, ${Math.floor(y)}, ${Math.floor(z)})`);
    
        const controller = new AbortController();
        const FLIGHT_TIMEOUT_MS = 20000;
        
        const timeoutId = setTimeout(() => {
          if (!controller.signal.aborted) {
            controller.abort();
          }
        }, FLIGHT_TIMEOUT_MS);
        
        try {
          const destination = new Vec3(x, y, z);
          
          await createCancellableFlightOperation(bot, destination, controller);
    
          return createResponse(`Successfully flew to position (${x}, ${y}, ${z}).`);
        } catch (error) {
          if (controller.signal.aborted) {
            const currentPosAfterTimeout = bot.entity.position;
            return createErrorResponse(
              `Flight timed out after ${FLIGHT_TIMEOUT_MS/1000} seconds. The destination may be unreachable. ` +
              `Current position: (${Math.floor(currentPosAfterTimeout.x)}, ${Math.floor(currentPosAfterTimeout.y)}, ${Math.floor(currentPosAfterTimeout.z)})`
            );
          }
          
          console.error('Flight error:', error);
          return createErrorResponse(error as Error);
        } finally {
          clearTimeout(timeoutId);
          bot.creative.stopFlying();
        }
      }
    );
  • Zod input schema defining the required x, y, z coordinates as numbers for the fly-to tool.
    {
      x: z.number().describe("X coordinate"),
      y: z.number().describe("Y coordinate"),
      z: z.number().describe("Z coordinate")
    },
  • Helper function that wraps bot.creative.flyTo in a Promise with AbortController support for cancellable flight operations.
    function createCancellableFlightOperation(
      bot: any, 
      destination: Vec3, 
      controller: AbortController
    ): Promise<boolean> {
      return new Promise((resolve, reject) => {
        let aborted = false;
        
        controller.signal.addEventListener('abort', () => {
          aborted = true;
          bot.creative.stopFlying();
          reject(new Error("Flight operation cancelled"));
        });
        
        bot.creative.flyTo(destination)
          .then(() => {
            if (!aborted) {
              resolve(true);
            }
          })
          .catch((err: any) => {
            if (!aborted) {
              reject(err);
            }
          });
      });
    }
  • src/bot.ts:145-145 (registration)
    Registration call that invokes registerFlightTools, which defines and registers the fly-to tool.
    registerFlightTools(server, bot);
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 ('fly to') but doesn't explain what 'fly' means operationally—e.g., does it bypass obstacles, require specific permissions, have speed/altitude limits, or consume resources? For a movement tool in a game-like context with siblings like 'dig-block' and 'place-block', this omission is significant, as the agent lacks critical context about how the tool behaves beyond the basic action.

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

Conciseness4/5

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

The description is a single, clear sentence that efficiently conveys the core action. It's front-loaded with the main purpose and avoids unnecessary words. However, given the tool's complexity in a game environment with many siblings, it might benefit from slightly more detail to improve usability, but it's not overly verbose or under-specified.

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 movement tool with no annotations and no output schema, the description is incomplete. It doesn't address key aspects like what happens on execution (e.g., does it return success/failure, handle pathfinding, or have side effects?), how it interacts with other tools (e.g., 'get-position' for verification), or environmental constraints. In a server with tools like 'detect-gamemode' and 'place-block', this lack of context makes it harder for an agent to use the tool effectively and safely.

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?

The input schema has 100% description coverage, with clear parameter descriptions (X, Y, Z coordinates). The description adds value by specifying that these coordinates define a 'specific position', implying a 3D destination. However, it doesn't provide additional context like coordinate system (e.g., world vs. relative), units, or constraints (e.g., valid ranges), so it doesn't fully compensate for potential gaps, but the schema does the heavy lifting, justifying a baseline above 3.

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 'Make the bot fly to a specific position' clearly states the action (fly to) and target (specific position), but it's somewhat vague about what 'fly' entails compared to other movement tools like 'move-to-position' or 'move-in-direction'. It doesn't explicitly distinguish itself from these siblings, leaving room for confusion about when to choose flying over other movement 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 provides no guidance on when to use this tool versus alternatives like 'move-to-position' or 'move-in-direction'. There's no mention of prerequisites (e.g., whether the bot needs to be in a flying-capable state), context (e.g., use for 3D navigation vs. 2D), or exclusions (e.g., not for precise block placement). This lack of guidance could lead to misuse in scenarios where other tools might be more appropriate.

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/zeeweebee/mcp-server'

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