Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

get-position

Retrieve the current in-game coordinates of a Minecraft bot controlled by the MCP Server, enabling precise tracking and navigation for AI-driven actions within the game world.

Instructions

Get the current position of the bot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that retrieves the bot's current position from bot.entity.position, floors the x, y, z coordinates, formats a response string, and returns it via createResponse. Handles errors with createErrorResponse.
    async (): Promise<McpResponse> => { try { const position = bot.entity.position; const pos = { x: Math.floor(position.x), y: Math.floor(position.y), z: Math.floor(position.z) }; return createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`); } catch (error) { return createErrorResponse(error as Error); } }
  • src/bot.ts:155-172 (registration)
    Registers the 'get-position' tool with the MCP server using server.tool(), providing a description, empty input schema object, and the inline handler function.
    "get-position", "Get the current position of the bot", {}, async (): Promise<McpResponse> => { try { const position = bot.entity.position; const pos = { x: Math.floor(position.x), y: Math.floor(position.y), z: Math.floor(position.z) }; return createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`); } catch (error) { return createErrorResponse(error as Error); } } );

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

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