bizhawk_get_info
Retrieve loaded ROM name, hash, frame count, memory domains, active domain, and available features. Use to confirm system state and capabilities before other emulator operations.
Instructions
PURPOSE: Get the loaded ROM's name and hash, current frame count, the list of available memory domains, the active default domain (the one used when 'domain' is omitted on read/write tool calls), and the bridge's capability map (which optional emu/client/savestate/joypad/memory methods this BizHawk build exposes). USAGE: Call after bizhawk_ping to learn what system is loaded and which optional features are available; before any memory tool call to confirm the active domain and avoid silent reads from the wrong address space; before pause / unpause / reset / screenshot / save_state to check the corresponding capabilities.* flag. BEHAVIOR: No side effects — pure read of emulator metadata. Returns 'unavailable' for fields the loaded core doesn't expose (rom_name when no ROM is loaded, framecount on cores without emu.framecount, etc.). RETURNS: Multi-line text with ROM, ROM hash, framecount, memory_domains list, active domain, and a list of any missing capabilities for this build.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:61-68 (registration)Tool registration definition for bizhawk_get_info — a no-side-effect introspection tool that returns ROM name, ROM hash, framecount, available memory domains, active default domain, and capability map of the loaded BizHawk core.
name: "bizhawk_get_info", description: "PURPOSE: Get the loaded ROM's name and hash, current frame count, the list of available memory domains, the active default domain (the one used when 'domain' is omitted on read/write tool calls), and the bridge's capability map (which optional emu/client/savestate/joypad/memory methods this BizHawk build exposes). " + "USAGE: Call after bizhawk_ping to learn what system is loaded and which optional features are available; before any memory tool call to confirm the active domain and avoid silent reads from the wrong address space; before pause / unpause / reset / screenshot / save_state to check the corresponding `capabilities.*` flag. " + "BEHAVIOR: No side effects — pure read of emulator metadata. Returns 'unavailable' for fields the loaded core doesn't expose (rom_name when no ROM is loaded, framecount on cores without emu.framecount, etc.). " + "RETURNS: Multi-line text with ROM, ROM hash, framecount, memory_domains list, active domain, and a list of any missing capabilities for this build.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:501-530 (handler)Handler for bizhawk_get_info tool — calls BizHawk RPC method 'get_info' via the TCP bridge, then formats the response into a multi-line text string with ROM info, framecount, memory domains, active domain, and missing capabilities.
case "bizhawk_get_info": { const r = await bh.call<{ rom_name?: string; rom_hash?: string; framecount?: number; memory_domains?: string[]; current_memory_domain?: string; capabilities?: Record<string, boolean>; }>("get_info"); const lines = [ `ROM: ${r.rom_name ?? "(unavailable)"}`, `ROM hash: ${r.rom_hash ?? "(unavailable)"}`, `Framecount: ${r.framecount ?? "(unavailable)"}`, ]; if (r.memory_domains?.length) { lines.push(""); lines.push(`Memory domains: ${r.memory_domains.join(", ")}`); if (r.current_memory_domain) { lines.push(`Active domain (used when 'domain' is omitted): ${r.current_memory_domain}`); } } if (r.capabilities) { const missing = Object.entries(r.capabilities).filter(([, v]) => !v).map(([k]) => k); if (missing.length) { lines.push(""); lines.push(`Missing capabilities on this BizHawk build: ${missing.join(", ")}`); } } return ok(lines.join("\n")); } - src/bizhawk.ts:235-264 (helper)The `call` method on BizhawkServer that enqueues RPC commands (including 'get_info') and returns a promise. This is the transport layer invoked by the tool handler to communicate with the BizHawk Lua bridge over TCP.
async call<T = unknown>(method: string, params: Record<string, unknown> = {}): Promise<T> { return new Promise<T>((resolve, reject) => { const id = this.nextId++; const pending: PendingCmd = { id, method, params, resolve: (r) => resolve(r as T), reject, }; const timer = setTimeout(() => { // Drop from queue if still waiting; from inflight if already sent. this.queue = this.queue.filter((p) => p.id !== id); this.inflight.delete(id); if (this.inflight.size === 0) this.awaitingResult = false; reject(new Error( `BizHawk call "${method}" timed out (${this.timeoutMs}ms) — ` + `is the bridge.lua script still polling?`, )); }, this.timeoutMs); // Wrap so the timer always clears const origResolve = pending.resolve, origReject = pending.reject; pending.resolve = (r) => { clearTimeout(timer); origResolve(r); }; pending.reject = (e) => { clearTimeout(timer); origReject(e); }; this.queue.push(pending); }); }