server_logs
Retrieve recent console output from a Minecraft server to debug startup issues or monitor server activity. Specify the number of log lines to fetch.
Instructions
Get recent server console output. Useful for debugging startup issues or monitoring activity.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | Number of recent log lines to retrieve (default: 50, max: 500) |
Implementation Reference
- src/tools/server-tools.ts:78-103 (handler)The 'server_logs' tool is registered and implemented in src/tools/server-tools.ts. It uses the ServerManager instance to fetch recent logs and returns them as text content.
server.tool( "server_logs", "Get recent server console output. Useful for debugging startup issues or monitoring activity.", { lines: z .number() .optional() .default(50) .describe("Number of recent log lines to retrieve (default: 50, max: 500)"), }, async ({ lines }) => { const count = Math.min(Math.max(1, lines), 500); const output = manager.getRecentOutput(count); if (output.length === 0) { return { content: [ { type: "text", text: "No server output available. The server may not have been started.", }, ], }; } return { content: [{ type: "text", text: output.join("\n") }] }; } );