dolphin_get_info
Reports the bridge version and Dolphin label for diagnostic purposes. Returns multi-line text.
Instructions
PURPOSE: Report what the bridge knows about its environment (bridge version, Dolphin label). v0.1.0 doesn't query game metadata — Felk's API doesn't expose disc ID / title directly, those have to be read from OS_GLOBALS at 0x80000020 yourself via dolphin_read_range. USAGE: Diagnostic. For game state, use dolphin_read_range(0x80000000, 32) and decode: bytes 0-3 are the disc ID (4-char ASCII), 4-5 are maker code, 6 is disc number, 7 is disc version. BEHAVIOR: No side effects. Same underlying call as dolphin_ping but presents fields explicitly. RETURNS: Multi-line text — Bridge version, Dolphin label.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:75-83 (schema)Tool schema definition for 'dolphin_get_info' — declares the tool name, description (documenting it uses bridge.ping under the hood), and an empty input schema (no required parameters).
{ name: "dolphin_get_info", description: "PURPOSE: Report what the bridge knows about its environment (bridge version, Dolphin label). v0.1.0 doesn't query game metadata — Felk's API doesn't expose disc ID / title directly, those have to be read from OS_GLOBALS at 0x80000020 yourself via dolphin_read_range. " + "USAGE: Diagnostic. For game state, use dolphin_read_range(0x80000000, 32) and decode: bytes 0-3 are the disc ID (4-char ASCII), 4-5 are maker code, 6 is disc number, 7 is disc version. " + "BEHAVIOR: No side effects. Same underlying call as dolphin_ping but presents fields explicitly. " + "RETURNS: Multi-line text — Bridge version, Dolphin label.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:501-507 (handler)Handler for 'dolphin_get_info' — calls bridge.ping via the DolphinClient and returns a formatted string with the bridge version and Dolphin label.
case "dolphin_get_info": { const r = await dol.call<{ bridge_version: string; dolphin: string }>("bridge.ping"); return ok( `Bridge version: ${r.bridge_version}\n` + `Dolphin label: ${r.dolphin}`, ); } - src/tools.ts:488-490 (registration)Registration of tools — the 'registerTools' function sets up the ListToolsRequestSchema handler that exposes the TOOLS array (which includes dolphin_get_info) to the MCP server.
export function registerTools(server: Server, dol: DolphinClient): void { server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); - src/dolphin.ts:184-212 (helper)The DolphinClient.call() method — generic RPC call used by the dolphin_get_info handler (calls bridge.ping). Sends a JSON request over TCP and awaits the ticketed response.
async call<T = unknown>(method: string, params: unknown[] = []): Promise<T> { await this.ensureConnected(); return new Promise<T>((resolve, reject) => { const id = this.nextId++; const pending: PendingCmd = { id, resolve: (r) => resolve(r as T), reject, }; const timer = setTimeout(() => { this.inflight.delete(id); reject(new Error( `Dolphin bridge call "${method}" timed out (${this.timeoutMs}ms) — ` + `is the mcp_bridge.py script still loaded in Dolphin's Scripting panel?`, )); }, this.timeoutMs); const origResolve = pending.resolve, origReject = pending.reject; pending.resolve = (r) => { clearTimeout(timer); origResolve(r); }; pending.reject = (e) => { clearTimeout(timer); origReject(e); }; this.inflight.set(id, pending); const msg = JSON.stringify({ id, method, params }); if (process.env.MCP_DOLPHIN_DEBUG) { process.stderr.write(`[trace] TX: ${msg}\n`); } this.sock!.write(msg + "\n"); }); }