server_status
Check Minecraft server status to monitor uptime, player count, and server state for administration and troubleshooting.
Instructions
Get the current server status including running state, uptime, online players, and MOTD.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/server-tools.ts:56-75 (handler)The "server_status" tool is registered and its handler is implemented here, calling manager.getStatus() to retrieve the data.
server.tool( "server_status", "Get the current server status including running state, uptime, online players, and MOTD.", {}, async () => { const status = await manager.getStatus(); const uptimeStr = status.uptime ? formatUptime(status.uptime) : "N/A"; const lines = [ `Status: ${status.running ? "🟢 Running" : "🔴 Stopped"}`, `PID: ${status.pid ?? "N/A"}`, `Uptime: ${uptimeStr}`, `Players: ${status.players.length > 0 ? status.players.join(", ") : "None"}`, `MOTD: ${status.motd ?? "N/A"}`, ]; return { content: [{ type: "text", text: lines.join("\n") }] }; } );