Skip to main content
Glama

load_rom

Load a GameBoy ROM file into the MCP GameBoy Server by specifying the file path, enabling interaction with the emulator for testing or gameplay.

Instructions

Load a GameBoy ROM file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
romPathYesPath to the ROM file

Implementation Reference

  • The MCP tool handler function for 'load_rom'. It invokes emulatorService.loadRom(romPath) and returns the resulting screen as ImageContent.
    async ({ romPath }): Promise<CallToolResult> => {
      // Load ROM using the service (already advances initial frames)
      const screen = emulatorService.loadRom(romPath);
      return { content: [screen] };
    }
  • Zod input schema for the 'load_rom' tool, defining the required 'romPath' parameter.
    {
      romPath: z.string().describe('Path to the ROM file')
    },
  • src/tools.ts:54-65 (registration)
    Registration of the 'load_rom' MCP tool on the server using server.tool(), including description, schema, and handler.
    server.tool(
      'load_rom',
      'Load a GameBoy ROM file',
      {
        romPath: z.string().describe('Path to the ROM file')
      },
      async ({ romPath }): Promise<CallToolResult> => {
        // Load ROM using the service (already advances initial frames)
        const screen = emulatorService.loadRom(romPath);
        return { content: [screen] };
      }
    );
  • TypeScript interface LoadRomToolSchema defining the input shape for the load_rom tool.
    export interface LoadRomToolSchema {
      romPath: string;
    }
  • EmulatorService.loadRom method: validates ROM file existence, loads it via the underlying emulator, advances initial frames, and returns the screen image.
    loadRom(romPath: string): ImageContent {
      log.info(`Attempting to load ROM: ${romPath}`);
      if (!fs.existsSync(romPath)) {
        log.error(`ROM file not found: ${romPath}`);
        throw new Error(`ROM file not found: ${romPath}`);
      }
    
      try {
        this.emulator.loadRom(romPath);
        log.info(`ROM loaded successfully: ${path.basename(romPath)}`);
    
        // Advance a few frames to initialize the screen
        for (let i = 0; i < 5; i++) {
          this.emulator.doFrame();
        }
        log.verbose('Advanced initial frames after ROM load');
    
        return this.getScreen();
      } catch (error) {
        log.error(`Error loading ROM: ${romPath}`, error instanceof Error ? error.message : String(error));
        throw new Error(`Failed to load ROM: ${romPath}. Reason: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like whether loading replaces a current ROM, requires specific file formats, has side effects, or returns any confirmation. This leaves significant gaps for a mutation 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 a single, efficient sentence with zero wasted words. It's appropriately sized for a simple tool and front-loads the core action, making it easy to parse quickly.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after loading (e.g., success indicators, error handling, or interaction with other tools like 'get_screen'), leaving critical context gaps for an agent.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents the 'romPath' parameter. The description adds no additional meaning beyond what's in the schema, such as file format requirements or path examples, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the action ('Load') and resource ('a GameBoy ROM file'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_roms' or 'is_rom_loaded', which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_roms' or 'is_rom_loaded'. It doesn't mention prerequisites (e.g., whether a ROM must be listed first) or exclusions, leaving usage context unclear.

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

Related 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/mario-andreschak/mcp-gameboy'

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