Skip to main content
Glama

romm_search

Search for ROMs by name across your game library, with optional filtering by platform and result limits.

Instructions

Search ROMs by name across the library.

query: Search term (required). platform_id: Filter to a single platform (0 = all). limit: Max results (default 20).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
platform_idNo
limitNo

Implementation Reference

  • The implementation of the `romm_search` tool, which searches for ROMs using a query, platform ID, and limit, and returns a formatted string of results.
    async def romm_search(query: str, platform_id: int = 0, limit: int = 20) -> str:
        """Search ROMs by name across the library.
    
        query: Search term (required).
        platform_id: Filter to a single platform (0 = all).
        limit: Max results (default 20).
        """
        params: dict = {
            "search_term": query,
            "limit": min(limit, 100),
            "offset": 0,
            "order_by": "name",
            "order_dir": "asc",
        }
        if platform_id:
            params["platform_ids"] = platform_id
    
        data = await _get("roms", params=params, long_timeout=True)
    
        items = []
        if isinstance(data, dict):
            items = data.get("items", [])
        elif isinstance(data, list):
            items = data
    
        if not items:
            return f"No ROMs found matching \"{query}\"."
    
        lines = [f"Search results for \"{query}\" ({len(items)} found):\n"]
        for i, rom in enumerate(items, 1):
            name = rom.get("name", "Unknown")
            platform = rom.get("platform_display_name") or rom.get("platform_slug", "?")
            size = rom.get("fs_size_bytes", 0)
            rom_id = rom.get("id", "?")
    
            line = f"  {i}. {name} [{platform}]"
            if size:
                line += f" — {_fmt_size(size)}"
            lines.append(line)
            lines.append(f"     ID: {rom_id}")
    
        return "\n".join(lines)
  • server.py:565-565 (registration)
    Registration of the `romm_search` tool using the @mcp.tool() decorator.
    @mcp.tool()

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/lodordev/mcp-romm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server