server_get_history
Retrieve historical runtime statistics for a Minecraft server to analyze CPU and RAM usage trends over time.
Instructions
Get historical runtime statistics for a Minecraft server (CPU, RAM over time, useful for graphing trends)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | Server ID or UUID |
Implementation Reference
- src/tools/server-console.ts:58-73 (handler)The handler implementation for the 'server_get_history' MCP tool, which fetches historical statistics for a Minecraft server from the Crafty client.
server.tool( "server_get_history", "Get historical runtime statistics for a Minecraft server (CPU, RAM over time, useful for graphing trends)", { server_id: z.string().describe("Server ID or UUID"), }, async ({ server_id }) => { try { const data = await client.get(`/servers/${server_id}/history`); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true }; } } );