Skip to main content
Glama

press_a

Simulate pressing the A button on a GameBoy emulator with customizable duration frames, enabling precise control for testing or gameplay scenarios.

Instructions

Press the A button on the GameBoy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
duration_framesNoNumber of frames to hold the button

Implementation Reference

  • MCP tool handler for all 'press_[button]' tools (including 'press_a'), which calls emulatorService.pressButton 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 press_[button] tools using Zod validation for optional duration_frames parameter.
    {
      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)
    Registers 'press_[button]' MCP tools dynamically for each GameBoyButton enum value (including 'press_a' for GameBoyButton.A).
    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] };
        }
      );
    });
  • Top-level call to registerGameBoyTools function, which registers all GameBoy tools including 'press_a'.
    registerGameBoyTools(server, emulatorService); // Pass emulatorService
  • GameBoyButton enum defining the 'A' button used to generate 'press_a' tool name.
    export enum GameBoyButton {
      UP = 'UP',
      DOWN = 'DOWN',
      LEFT = 'LEFT',
      RIGHT = 'RIGHT',
      A = 'A',
      B = 'B',
      START = 'START',
      SELECT = 'SELECT'
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action but doesn't disclose behavioral traits like whether this is a read-only or destructive operation, what happens if no GameBoy is connected, whether it requires specific permissions, or what the expected outcome is. The description is minimal and lacks important operational context.

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 essential information immediately.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what happens after pressing the button, whether there's visual/audio feedback, error conditions, or how this interacts with other tools like wait_frames or get_screen. For a tool that likely triggers game state changes, more context is needed.

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 already fully documents the single parameter (duration_frames). The description doesn't add any parameter semantics beyond what's in the schema, but since schema coverage is high, the baseline score of 3 is appropriate.

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 A button on the GameBoy'), distinguishing it from sibling tools like press_b, press_up, etc. It's unambiguous about what physical/virtual button is being activated.

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 context (GameBoy button pressing) but doesn't explicitly state when to use this tool versus alternatives like press_b or press_start. No guidance is provided about prerequisites (e.g., whether a ROM must be loaded first) or exclusions.

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