Skip to main content
Glama

press_left

Use this tool to press and hold the LEFT button on a GameBoy emulator for a specified duration in frames, enabling precise control for in-game actions or navigation.

Instructions

Press the LEFT button on the GameBoy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
duration_framesNoNumber of frames to hold the button

Implementation Reference

  • Handler logic for the 'press_left' tool (shared with other press_* tools): presses the LEFT button for the specified duration and returns the current screen image.
    async ({ duration_frames }): Promise<CallToolResult> => {
      // Press the button using the service (advances one frame)
      emulatorService.pressButton(button, duration_frames);
    
      // Return the current screen using the service
      const screen = emulatorService.getScreen();
      return { content: [screen] };
    }
  • Input schema for 'press_left' tool: optional duration_frames (number of frames to hold LEFT button, default 25).
    {
      duration_frames: z.number().int().positive().optional().default(1).describe('Number of frames to hold the button').default(25)
    },
  • src/tools.ts:20-37 (registration)
    Dynamic registration of 'press_left' tool (for GameBoyButton.LEFT) along with other press_* tools on the MCP server.
    // Register button press tools
    Object.values(GameBoyButton).forEach(button => {
      server.tool(
        `press_${button.toLowerCase()}`,
        `Press the ${button} button on the GameBoy`,
        {
          duration_frames: z.number().int().positive().optional().default(1).describe('Number of frames to hold the button').default(25)
        },
        async ({ duration_frames }): Promise<CallToolResult> => {
          // Press the button using the service (advances one frame)
          emulatorService.pressButton(button, duration_frames);
    
          // Return the current screen using the service
          const screen = emulatorService.getScreen();
          return { content: [screen] };
        }
      );
    });
  • GameBoyButton enum defining the LEFT button used to register and identify the 'press_left' tool.
    export enum GameBoyButton {
      UP = 'UP',
      DOWN = 'DOWN',
      LEFT = 'LEFT',
      RIGHT = 'RIGHT',
      A = 'A',
      B = 'B',
      START = 'START',
      SELECT = 'SELECT'
    }
  • Core pressButton implementation in EmulatorService that handles pressing the LEFT button on the underlying GameBoyEmulator.
    pressButton(button: GameBoyButton, durationFrames: number): ImageContent {
      log.debug(`Pressing button: ${button}`);
      if (!this.isRomLoaded()) {
        log.warn('Attempted to press button with no ROM loaded');
        throw new Error('No ROM loaded');
      }
      this.emulator.pressButton(button, durationFrames); // This advances one frame
      return this.getScreen();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action but lacks behavioral details such as whether this requires a loaded ROM, what happens if pressed without context, or any side effects. The description is minimal and does not compensate for the absence of annotations.

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 that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

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's simplicity (one parameter with full schema coverage, no output schema), the description is adequate but lacks context about when or why to use it, especially relative to siblings. It covers the basic action but does not provide enough guidance for optimal agent decision-making in a gaming context.

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 description mentions no parameters, while the input schema has one parameter with 100% coverage. Since there are zero parameters described in the description, it meets the baseline of 4, as it does not need to compensate for schema gaps. The schema fully documents the parameter.

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 ('Press') and target resource ('the LEFT button on the GameBoy'), distinguishing it from sibling tools like press_a, press_b, etc. It precisely communicates what the tool does without ambiguity.

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

Usage Guidelines3/5

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

The description implies usage for GameBoy button pressing but provides no explicit guidance on when to use this tool versus alternatives (e.g., press_right, press_up) or any prerequisites. It relies on the tool name and context for implied usage.

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