Skip to main content
Glama

press_up

Holds the UP button on a GameBoy emulator for a specified duration using the MCP GameBoy Server, enabling precise control for in-game actions or navigation.

Instructions

Press the UP button on the GameBoy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
duration_framesNoNumber of frames to hold the button

Implementation Reference

  • The inline handler function for the press_up tool (dynamically generated when button='UP'). It presses the UP button for the specified duration_frames and returns the current screen as ImageContent.
    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 the press_up tool: duration_frames as positive integer (default 1 or 25).
      duration_frames: z.number().int().positive().optional().default(1).describe('Number of frames to hold the button').default(25)
    },
  • src/tools.ts:21-37 (registration)
    Dynamic registration of press_up tool via loop over GameBoyButton values (includes 'UP'), using server.tool() with name `press_${button.toLowerCase()}`
    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 providing the 'UP' value used to generate the 'press_up' tool name.
    export enum GameBoyButton {
      UP = 'UP',
      DOWN = 'DOWN',
      LEFT = 'LEFT',
      RIGHT = 'RIGHT',
      A = 'A',
      B = 'B',
      START = 'START',
      SELECT = 'SELECT'
    }
  • Supporting pressButton method in EmulatorService called by the tool handler to perform the actual button press.
    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 of behavioral disclosure. It states the action ('Press') but does not explain what pressing the button actually does in the context (e.g., triggers a game input, may affect game state), whether it requires a loaded ROM, or any side effects like timing or interactions with other tools. This leaves significant gaps for a tool that likely interacts with game state.

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, clear sentence with zero wasted words. It is front-loaded with the core action and target, making it highly efficient and easy to parse.

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?

Given the complexity of a tool that interacts with a GameBoy emulator (implied by sibling tools like load_rom and get_screen), the description is incomplete. It lacks context on prerequisites (e.g., needing a ROM loaded), behavioral details (e.g., how pressing affects game state), and there is no output schema to clarify return values. With no annotations and minimal description, it does not provide enough information for safe and effective use.

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?

The description does not mention parameters at all. However, the input schema has 1 parameter with 100% description coverage (duration_frames is well-documented in the schema). Since schema coverage is high, the baseline score is 3, as the description adds no additional parameter information beyond what the schema provides.

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 UP button on the GameBoy'), distinguishing it from sibling tools like press_a, press_b, press_down, 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 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. It does not mention scenarios for pressing UP (e.g., navigating menus, moving characters) or differentiate it from other directional buttons like press_down, press_left, or press_right. Usage is implied but not explicitly stated.

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