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);

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are present, and the description only states a simple action. It does not disclose behavioral traits such as whether the flight is instantaneous or animated, if it ignores obstacles, or if it has any prerequisites like being in the air. This is insufficient for a tool with no annotation safety net.

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 sentence that is concise and front-loaded. However, it sacrifices informativeness for brevity; a slightly longer description could provide more guidance without being verbose.

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

Completeness3/5

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

For a simple coordinate flight tool with no output schema and no annotations, the description is minimally adequate. It conveys the core function but lacks details on behavior, return values, or prerequisites, which a more complete description would include.

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?

All three parameters (x, y, z) have descriptions in the schema, achieving 100% coverage. The tool description adds no additional meaning beyond the schema, so it meets the baseline without adding extra value.

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

Purpose4/5

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

The description clearly states the verb 'fly' and the resource 'to a specific position', indicating the tool's purpose. However, it does not distinguish it from sibling movement tools like 'move-to-position', which may cause confusion for an AI agent choosing between them.

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 is provided on when to use this tool versus alternatives such as 'move-to-position' or 'jump'. The description lacks context for appropriate usage, leaving the agent to infer from the tool name alone.

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