Read the Pterodactyl live console
ptero_get_console_logFetch recent console output from a Pterodactyl server via its live websocket. Retrieve the backlog plus new lines, with optional filtering, to monitor or verify command effects.
Instructions
Connect to the server's live console websocket and return the backlog it hands back on connect (the node's ring buffer, ~150 most recent lines by default) plus whatever new lines stream in during the collection window, then disconnect.
Pterodactyl has no "give me the last N lines" request over REST — this websocket round trip is the only way to read console output, and what you get is a live snapshot, not a query over history.
The buffer rolls over quickly: roughly an hour after boot the plugin startup lines are already gone from it. For boot-time or plugin-load output, use ptero_read_file on logs/latest.log instead — that has the full run history.
After calling ptero_send_console_command, you MUST call this tool to see what the command did: dispatching a command never returns its output by itself.
filter narrows the returned lines (case-insensitive substring, or a regex if it parses as one) without needing a wider window — e.g. filter: "geyser" to isolate Geyser lines in a busy log.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Optional case-insensitive filter applied to lines AFTER they are collected: a regular expression if `filter` parses as one, otherwise a plain substring match. Useful for pulling out e.g. Geyser lines ("geyser") from a busy console without widening the window. | |
| server | No | Server short identifier (e.g. 1a2b3c4d). Omit to use PTERODACTYL_DEFAULT_SERVER. Call ptero_list_servers to discover valid identifiers. | |
| max_lines | No | Stop collecting once this many lines have been gathered (1-1000, default 400). The node's backlog alone is ~150 lines, so the default leaves room to also observe lines streamed during `window_seconds`. `truncated: true` in the result means this cap cut collection short. | |
| window_seconds | No | How long to stay connected collecting console output, in seconds (1-60, default 5). Collection stops early once `max_lines` is reached. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Caveats worth surfacing: the server was offline, the node throttled a request, or the filter matched nothing. | |
| lines | Yes | Collected console lines, ANSI escape codes stripped, oldest first. Filtered by `filter` when one was given. | |
| state | Yes | Wings-reported power state at the time of collection (offline/starting/running/stopping), or "unknown" if no status event arrived during the window. | |
| server | Yes | Server short identifier the log was read from. | |
| truncated | Yes | True when `max_lines` cut off further backlog or streamed output. | |
| line_count | Yes | Number of lines in `lines` (after filtering). | |
| duration_ms | Yes | Wall-clock time the collection took, in milliseconds. | |
| window_seconds | Yes | The collection window that was actually used. |