Skip to main content
Glama

list_roms

Retrieve a list of all available GameBoy ROM files to access and manage game data for use with the MCP GameBoy Server toolset.

Instructions

List all available GameBoy ROM files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'list_roms' tool. Lists GameBoy ROM files (.gb and .gbc) from the 'roms' directory (creating it if necessary), constructs an array of objects with 'name' and 'path', returns as JSON-formatted TextContent, or error details if failed.
    async (): Promise<CallToolResult> => {
      try {
        const romsDir = path.join(process.cwd(), 'roms');
        
        // Create roms directory if it doesn't exist
        if (!fs.existsSync(romsDir)) {
          fs.mkdirSync(romsDir);
          log.info('Created roms directory');
        }
        
        // Get list of ROM files
        const romFiles = fs.readdirSync(romsDir)
          .filter(file => file.endsWith('.gb') || file.endsWith('.gbc'))
          .map(file => ({
            name: file,
            path: path.join(romsDir, file)
          }));
        
        const responseText: TextContent = {
          type: 'text',
          text: JSON.stringify(romFiles)
        };
        
        log.verbose('Listed available ROMs', JSON.stringify({ 
          count: romFiles.length, 
          roms: romFiles 
        }));
        
        return { content: [responseText] };
      } catch (error) {
        log.error('Error listing ROMs:', error instanceof Error ? error.message : String(error));
        
        const errorText: TextContent = {
          type: 'text',
          text: JSON.stringify({
            error: 'Failed to list ROMs',
            message: error instanceof Error ? error.message : String(error)
          })
        };
        
        return { content: [errorText] };
      }
    }
  • src/tools.ts:106-153 (registration)
    Registers the 'list_roms' tool with the MCP server using server.tool(), providing description 'List all available GameBoy ROM files' and empty input schema {}.
    server.tool(
      'list_roms',
      'List all available GameBoy ROM files',
      {},
      async (): Promise<CallToolResult> => {
        try {
          const romsDir = path.join(process.cwd(), 'roms');
          
          // Create roms directory if it doesn't exist
          if (!fs.existsSync(romsDir)) {
            fs.mkdirSync(romsDir);
            log.info('Created roms directory');
          }
          
          // Get list of ROM files
          const romFiles = fs.readdirSync(romsDir)
            .filter(file => file.endsWith('.gb') || file.endsWith('.gbc'))
            .map(file => ({
              name: file,
              path: path.join(romsDir, file)
            }));
          
          const responseText: TextContent = {
            type: 'text',
            text: JSON.stringify(romFiles)
          };
          
          log.verbose('Listed available ROMs', JSON.stringify({ 
            count: romFiles.length, 
            roms: romFiles 
          }));
          
          return { content: [responseText] };
        } catch (error) {
          log.error('Error listing ROMs:', error instanceof Error ? error.message : String(error));
          
          const errorText: TextContent = {
            type: 'text',
            text: JSON.stringify({
              error: 'Failed to list ROMs',
              message: error instanceof Error ? error.message : String(error)
            })
          };
          
          return { content: [errorText] };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool lists ROMs but doesn't describe return format (e.g., list of filenames, metadata), pagination, error conditions, or performance characteristics. This leaves significant gaps for an agent to understand how to interpret results.

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 function with zero wasted words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 for a read operation. It doesn't explain what 'list' entails (e.g., format, structure, or limitations), leaving the agent uncertain about how to handle the output. For a tool with no structured behavioral hints, more context is needed.

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 no parameter documentation is needed. The description appropriately focuses on the tool's purpose without redundant parameter details, meeting the baseline for parameterless 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 ('List') and resource ('all available GameBoy ROM files'), distinguishing it from sibling tools like load_rom (which loads a specific ROM) or get_screen (which retrieves screen state). It precisely communicates the tool's function 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 retrieving ROM lists, but lacks explicit guidance on when to use this versus alternatives like is_rom_loaded (which checks a specific ROM's status) or load_rom (which loads a ROM). It provides basic context but no exclusions or comparative advice.

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