Skip to main content
Glama

getServerInfo

Retrieve current server details including connection status, version, and available features for managing Minecraft gameplay remotely.

Instructions

Get information about the currently connected server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The asynchronous handler function that executes the logic for the getServerInfo tool. It verifies bot connection and returns detailed server and bot status information.
    async () => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { return createSuccessResponse(`Server Info: Host: ${botState.connectionInfo.host} Port: ${botState.connectionInfo.port} Version: ${botState.bot.version} Game Mode: ${botState.bot.game.gameMode} Difficulty: ${botState.bot.game.difficulty} Time: ${botState.bot.time.timeOfDay} Players Online: ${Object.keys(botState.bot.players).length} Your Health: ${botState.bot.health ? botState.bot.health.toFixed(1) : 'N/A'} Your Food: ${botState.bot.food ? botState.bot.food.toFixed(1) : 'N/A'}`) } catch (error) { return createErrorResponse(error) } }
  • The server.tool() call that registers the getServerInfo tool, including its name, description, empty schema object, and inline handler function.
    // Tool to get server information server.tool( 'getServerInfo', 'Get information about the currently connected server', {}, async () => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { return createSuccessResponse(`Server Info: Host: ${botState.connectionInfo.host} Port: ${botState.connectionInfo.port} Version: ${botState.bot.version} Game Mode: ${botState.bot.game.gameMode} Difficulty: ${botState.bot.game.difficulty} Time: ${botState.bot.time.timeOfDay} Players Online: ${Object.keys(botState.bot.players).length} Your Health: ${botState.bot.health ? botState.bot.health.toFixed(1) : 'N/A'} Your Food: ${botState.bot.food ? botState.bot.food.toFixed(1) : 'N/A'}`) } catch (error) { return createErrorResponse(error) } } )
  • Call to registerInfoTools() within the registerAllTools() function, which indirectly registers the getServerInfo tool.
    // Information tools registerInfoTools()

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