Skip to main content
Glama

getServerInfo

Retrieve details about the currently connected Minecraft server, including status, players, and settings, enabling informed actions and management for remote gameplay.

Instructions

Get information about the currently connected server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the getServerInfo tool using server.tool, including name, description, empty schema, and inline handler function.
    '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) } } ) }
  • The handler function that implements the getServerInfo tool logic. It checks connection status, then returns server information including host, port, version, game mode, difficulty, time, player count, health, and food via createSuccessResponse.
    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) } } )

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