mgba_get_info
Retrieve the currently-loaded game title, code, platform, frame count, and capabilities list to detect which optional emulation methods are available.
Instructions
Get the currently-loaded game title, game code (e.g. AGBE), platform identifier, current frame count, and a capabilities object listing which optional emu methods this build of mGBA supports (pause, frameAdvance, saveStateSlot, etc.). Use the capabilities map to feature-detect before calling tools that depend on optional methods.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:49-53 (schema)Tool definition for mgba_get_info including name, description, and empty inputSchema (no inputs required).
{ name: "mgba_get_info", description: "Get the currently-loaded game title, game code (e.g. AGBE), platform identifier, current frame count, and a `capabilities` object listing which optional emu methods this build of mGBA supports (pause, frameAdvance, saveStateSlot, etc.). Use the capabilities map to feature-detect before calling tools that depend on optional methods.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:271-293 (handler)Handler for mgba_get_info: calls the 'get_info' RPC method on the mGBA bridge via MgbaClient, and formats the returned title, code, platform, frame count, and capabilities into a human-readable response.
case "mgba_get_info": { const r = await mgba.call<{ title?: string; code?: string; frame?: number; platform?: number | string; capabilities?: Record<string, boolean>; }>("get_info"); const lines = [ `Title: ${r.title ?? "(unavailable)"}`, `Code: ${r.code ?? "(unavailable)"}`, `Platform: ${r.platform ?? "(unavailable)"}`, `Frame: ${r.frame ?? "(unavailable)"}`, ]; if (r.capabilities) { const present = Object.entries(r.capabilities).filter(([, v]) => v).map(([k]) => k); const missing = Object.entries(r.capabilities).filter(([, v]) => !v).map(([k]) => k); lines.push(""); lines.push(`Capabilities present: ${present.length ? present.join(", ") : "(none)"}`); if (missing.length) lines.push(`Missing on this build: ${missing.join(", ")}`); } return ok(lines.join("\n")); } - src/tools.ts:258-259 (registration)ListToolsRequestSchema handler registers the TOOLS array (including mgba_get_info) with the MCP server.
export function registerTools(server: Server, mgba: MgbaClient): void { server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));