Skip to main content
Glama

get_screen

Retrieve the current GameBoy screen frame to monitor or analyze gameplay, advancing the emulator by one frame automatically for precise control.

Instructions

Get the current GameBoy screen (advances one frame)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler function for the 'get_screen' MCP tool. Advances the emulator by one frame and returns the current screen as ImageContent.
    async (): Promise<CallToolResult> => {
      // Advance one frame and get the screen using the service
      const screen = emulatorService.advanceFrameAndGetScreen();
      return { content: [screen] };
    }
  • src/tools.ts:68-77 (registration)
    Registration of the 'get_screen' tool using McpServer.tool() method, including description, empty input schema, and handler.
    server.tool(
      'get_screen',
      'Get the current GameBoy screen (advances one frame)', // Updated description
      {},
      async (): Promise<CallToolResult> => {
        // Advance one frame and get the screen using the service
        const screen = emulatorService.advanceFrameAndGetScreen();
        return { content: [screen] };
      }
    );
  • TypeScript interface defining the input schema for get_screen tool (no parameters).
    export interface GetScreenToolSchema {
      // No parameters needed
    }
  • Helper method advanceFrameAndGetScreen() called by the tool handler to advance one frame and retrieve the screen image.
    advanceFrameAndGetScreen(): ImageContent {
      log.verbose('Advancing one frame and getting screen');
      if (!this.isRomLoaded()) {
        log.warn('Attempted to advance frame with no ROM loaded');
        throw new Error('No ROM loaded');
      }
      this.emulator.doFrame();
      return this.getScreen();
    }
  • Helper method getScreen() that captures the current emulator screen as base64 PNG ImageContent, used by advanceFrameAndGetScreen().
    getScreen(): ImageContent {
      log.verbose('Getting current screen');
      if (!this.isRomLoaded()) {
        log.warn('Attempted to get screen with no ROM loaded');
        throw new Error('No ROM loaded');
      }
      const screenBase64 = this.emulator.getScreenAsBase64();
      const screen: ImageContent = {
        type: 'image',
        data: screenBase64,
        mimeType: 'image/png'
      };
      log.verbose('Screen data retrieved', JSON.stringify({ mimeType: screen.mimeType, dataLength: screen.data.length }));
      return screen;
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the key behavioral trait that the tool 'advances one frame', which is crucial for understanding its side effect. However, it doesn't mention other important aspects like whether this requires a loaded ROM, what happens if no ROM is loaded, or what the output format looks like, leaving gaps in behavioral understanding.

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 perfectly concise at 8 words, front-loading the core purpose ('Get the current GameBoy screen') and following with the critical behavioral detail ('advances one frame'). Every word earns its place with no redundancy or unnecessary elaboration.

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?

Given the tool has no parameters, no annotations, and no output schema, the description provides adequate basic information but lacks completeness. It doesn't specify what 'Get' returns (image data? state description?), prerequisites (must a ROM be loaded?), or error conditions. For a tool that presumably returns visual data, more context about the output would be helpful.

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 tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the lack of inputs. The description appropriately doesn't waste space discussing parameters, maintaining focus on the tool's purpose and behavior. This meets the baseline expectation for zero-parameter tools.

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 specific action ('Get the current GameBoy screen') and distinguishes it from siblings by specifying it 'advances one frame', which differentiates it from tools like 'wait_frames' or button presses. It uses a precise verb+resource combination that leaves no ambiguity about what the tool does.

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 implies usage context by mentioning 'advances one frame', suggesting this should be used when needing to capture screen state while progressing the emulation. However, it doesn't explicitly state when NOT to use it or name alternatives among siblings like 'wait_frames' for different timing needs, so it falls short of a perfect 5.

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