retroarch_get_status
Get the current emulation status including playing/paused state, system identifier, game basename, and CRC32; returns 'contentless' when no game is loaded.
Instructions
Get the current emulation status: playing/paused state, system identifier, game basename, and CRC32. Returns 'contentless' if no game is loaded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:189-198 (handler)Handler for retroarch_get_status: calls ra.getStatus() and formats the response with state, system, game, and CRC32.
case "retroarch_get_status": { const s = await ra.getStatus(); if (s.state === "contentless") return ok("No content loaded"); return ok( `State: ${s.state}\n` + `System: ${s.system}\n` + `Game: ${s.game}\n` + `CRC32: ${s.crc32 ?? "(none reported)"}`, ); } - src/retroarch.ts:128-146 (helper)The RetroArchClient.getStatus() helper that sends the GET_STATUS command over UDP and parses the response into an EmuStatus object.
async getStatus(): Promise<EmuStatus> { const r = (await this.query("GET_STATUS")).toString().trim(); // "GET_STATUS PAUSED system_id,game_basename,crc32=XXXXXXXX" // "GET_STATUS PLAYING ..." // "GET_STATUS CONTENTLESS" const m = r.match(/^GET_STATUS\s+(\w+)(?:\s+([^,]+),(.+?)(?:,crc32=([0-9a-fA-F]+))?)?$/); if (!m) throw new Error(`unexpected GET_STATUS reply: ${r}`); const state = m[1].toLowerCase(); if (state === "contentless") return { state: "contentless" }; if (state !== "playing" && state !== "paused") { throw new Error(`unexpected emulator state: ${state}`); } return { state, system: m[2] ?? "(unknown)", game: m[3] ?? "(unknown)", crc32: m[4], }; } - src/retroarch.ts:32-34 (schema)Type definition for the status response returned by getStatus().
export type EmuStatus = | { state: "playing" | "paused"; system: string; game: string; crc32?: string } | { state: "contentless" }; - src/tools.ts:26-30 (registration)Tool schema registration for retroarch_get_status in the TOOLS array.
{ name: "retroarch_get_status", description: "Get the current emulation status: playing/paused state, system identifier, game basename, and CRC32. Returns 'contentless' if no game is loaded.", inputSchema: { type: "object", properties: {} }, },