Skip to main content
Glama

wait_frames

Pauses execution for a specified number of frames in the MCP GameBoy Server, enabling precise timing control during GameBoy emulation operations.

Instructions

Wait for a specified number of frames

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
duration_framesNoNumber of frames to wait

Implementation Reference

  • src/tools.ts:40-51 (registration)
    Registers the wait_frames tool with the MCP server. Includes inline Zod input schema, description, and the handler function that executes emulatorService.waitFrames and returns the resulting screen as ImageContent.
    server.tool(
      'wait_frames',
      'Wait for a specified number of frames',
      {
        duration_frames: z.number().int().positive().describe('Number of frames to wait').default(100)
      },
      async ({ duration_frames }): Promise<CallToolResult> => {
        // Wait for frames using the service
        const screen = emulatorService.waitFrames(duration_frames);
        return { content: [screen] };
      }
    );
  • TypeScript interface defining the expected input parameters for the wait_frames tool.
    export interface WaitFramesToolSchema {
      duration_frames: number;
    }
  • Core implementation of frame waiting in EmulatorService class. Advances the emulator for the specified number of frames by calling doFrame() in a loop and returns the current screen.
    waitFrames(durationFrames: number): ImageContent {
      log.debug(`Waiting for ${durationFrames} frames`);
      if (!this.isRomLoaded()) {
        log.warn('Attempted to wait frames with no ROM loaded');
        throw new Error('No ROM loaded');
      }
      for (let i = 0; i < durationFrames; i++) {
        this.emulator.doFrame();
      }
      log.verbose(`Waited ${durationFrames} frames`, JSON.stringify({ frames: durationFrames }));
      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 full burden of behavioral disclosure. The description only states what the tool does ('wait for frames') but doesn't disclose critical behavioral traits like whether this is a blocking operation, how it interacts with other tools (e.g., can other actions be queued during the wait), what happens if interrupted, or timing implications. For a timing tool with zero annotation coverage, this is inadequate.

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 - a single sentence that directly states the tool's function with zero wasted words. It's front-loaded with the essential information and earns its place efficiently.

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 that this is a timing/waiting tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'wait' means operationally (blocking vs. non-blocking), what constitutes a 'frame' in this context, how this interacts with other emulation tools, or what the agent should expect after the wait completes. For a tool that controls timing in what appears to be a game emulation environment, this leaves significant gaps.

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%, with the single parameter 'duration_frames' clearly documented in the schema as 'Number of frames to wait' with a default of 100 and exclusiveMinimum of 0. The description adds no additional parameter semantics beyond what the schema already provides. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('wait') and the resource ('frames'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like press_a or press_b, which are also timing-related actions in a gaming/emulation context. The description is specific but lacks sibling distinction.

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. In a gaming emulation context with tools like press_a, press_b, and various press directions, there's no indication of whether wait_frames should be used for timing delays between actions, loading screens, or other scenarios. No explicit when/when-not or alternative tools are mentioned.

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