Skip to main content
Glama
dmang-dev

mcp-retroarch

retroarch_get_config

Retrieve specific RetroArch configuration values such as save directories, system path, or fullscreen mode by providing the parameter name.

Instructions

Read a RetroArch configuration parameter by name. Useful values: savefile_directory, savestate_directory, system_directory, cache_directory, log_dir, runtime_log_directory, netplay_nickname, video_fullscreen. Note: screenshot_directory is NOT exposed via this command — RetroArch saves screenshots wherever it's configured but doesn't let the NCI report that path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesConfig parameter name (see description for supported values)

Implementation Reference

  • Tool schema definition for retroarch_get_config — defines name, description, and inputSchema (requires 'name' string param).
    {
      name: "retroarch_get_config",
      description: "Read a RetroArch configuration parameter by name. Useful values: `savefile_directory`, `savestate_directory`, `system_directory`, `cache_directory`, `log_dir`, `runtime_log_directory`, `netplay_nickname`, `video_fullscreen`. Note: `screenshot_directory` is NOT exposed via this command — RetroArch saves screenshots wherever it's configured but doesn't let the NCI report that path.",
      inputSchema: {
        type: "object",
        required: ["name"],
        properties: {
          name: { type: "string", description: "Config parameter name (see description for supported values)" },
        },
      },
    },
  • Handler for retroarch_get_config — calls ra.getConfigParam() with the provided name and returns the value as a formatted string.
    case "retroarch_get_config": {
      const v = await ra.getConfigParam(p.name as string);
      return ok(`${p.name} = ${v}`);
    }
  • RetroArchClient.getConfigParam() — sends GET_CONFIG_PARAM command over UDP, parses the echoed response to extract the config value.
    /** GET_CONFIG_PARAM — query select RetroArch config values by name. */
    async getConfigParam(name: string): Promise<string> {
      const r = (await this.query(`GET_CONFIG_PARAM ${name}`)).toString().trim();
      // "GET_CONFIG_PARAM <name> <value>"
      const prefix = `GET_CONFIG_PARAM ${name} `;
      if (!r.startsWith(prefix)) throw new Error(`unexpected GET_CONFIG_PARAM reply: ${r}`);
      return r.slice(prefix.length);
    }
  • src/tools.ts:176-246 (registration)
    The registerTools function registers all tools (including retroarch_get_config) with the MCP server via ListToolsRequestSchema and CallToolRequestSchema handlers. The tool is part of the TOOLS array (line 32) and its case is handled in the switch (line 200).
    export function registerTools(server: Server, ra: RetroArchClient): void {
      server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
    
      server.setRequestHandler(CallToolRequestSchema, async (req) => {
        const { name, arguments: args = {} } = req.params;
        const p = args as Record<string, unknown>;
    
        switch (name) {
          case "retroarch_ping": {
            const v = await ra.getVersion();
            return ok(`OK — RetroArch ${v}`);
          }
    
          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)"}`,
            );
          }
    
          case "retroarch_get_config": {
            const v = await ra.getConfigParam(p.name as string);
            return ok(`${p.name} = ${v}`);
          }
    
          case "retroarch_read_memory": {
            const bytes = await ra.readMemory(p.address as number, p.length as number);
            const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0").toUpperCase()).join(" ");
            return ok(`${addrHex(p.address as number)} [${bytes.length} bytes]:\n${hex}`);
          }
    
          case "retroarch_write_memory": {
            const n = await ra.writeMemory(p.address as number, p.bytes as number[]);
            return ok(`Wrote ${n} bytes → ${addrHex(p.address as number)}`);
          }
    
          case "retroarch_read_ram": {
            const bytes = await ra.readRam(p.address as number, p.length as number);
            const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0").toUpperCase()).join(" ");
            return ok(`${addrHex(p.address as number)} [${bytes.length} bytes, CHEEVOS]:\n${hex}`);
          }
    
          case "retroarch_write_ram": {
            await ra.writeRam(p.address as number, p.bytes as number[]);
            return ok(`Wrote ${(p.bytes as number[]).length} bytes → ${addrHex(p.address as number)} (CHEEVOS, no ack)`);
          }
    
          case "retroarch_pause_toggle":  await ra.pauseToggle();   return ok("Pause toggled");
          case "retroarch_frame_advance": await ra.frameAdvance();  return ok("Advanced one frame");
          case "retroarch_reset":         await ra.reset();         return ok("Game reset");
          case "retroarch_screenshot":    await ra.screenshot();    return ok("Screenshot saved to RetroArch's configured screenshot directory");
          case "retroarch_show_message": {
            await ra.showMessage(p.message as string);
            return ok(`Showed: ${p.message}`);
          }
    
          case "retroarch_save_state_current":  await ra.saveStateCurrent();          return ok("Saved to current slot");
          case "retroarch_load_state_current":  await ra.loadStateCurrent();          return ok("Loaded from current slot");
          case "retroarch_load_state_slot":     await ra.loadStateSlot(p.slot as number); return ok(`Loaded from slot ${p.slot}`);
          case "retroarch_state_slot_plus":     await ra.stateSlotPlus();             return ok("Incremented current slot");
          case "retroarch_state_slot_minus":    await ra.stateSlotMinus();            return ok("Decremented current slot");
    
          default:
            throw new Error(`Unknown tool: ${name}`);
        }
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description neglects to mention behavioral traits like side effects (none, read-only), required permissions, or response details. This is a significant gap for a read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with three sentences: purpose, examples, and a caveat. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers input well but omits the return format or value type. Without an output schema, a brief note on what the tool returns (e.g., a string value) would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema describes the 'name' parameter with a reference to the description. The description adds value by listing supported values and a notable exclusion, enhancing understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads a RetroArch configuration parameter by name. It lists useful values and distinguishes from siblings by focusing on config retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides concrete examples of when to use (specific parameter names) and explicitly notes that screenshot_directory is not available. No alternatives mentioned, but the guidance is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dmang-dev/mcp-retroarch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server