romm_search_by_hash
Identify ROM files using CRC32, MD5, or SHA1 hash values to verify authenticity and retrieve metadata.
Instructions
Identify a ROM by file hash. Provide at least one hash value.
crc_hash: CRC32 hash string. md5_hash: MD5 hash string. sha1_hash: SHA1 hash string.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crc_hash | No | ||
| md5_hash | No | ||
| sha1_hash | No |
Implementation Reference
- server.py:611-649 (handler)The handler function 'romm_search_by_hash' processes hash parameters, queries the 'roms/by-hash' endpoint, and formats the result.
async def romm_search_by_hash( crc_hash: str = "", md5_hash: str = "", sha1_hash: str = "", ) -> str: """Identify a ROM by file hash. Provide at least one hash value. crc_hash: CRC32 hash string. md5_hash: MD5 hash string. sha1_hash: SHA1 hash string. """ params: dict = {} if crc_hash: params["crc_hash"] = crc_hash.strip() if md5_hash: params["md5_hash"] = md5_hash.strip() if sha1_hash: params["sha1_hash"] = sha1_hash.strip() if not params: return "At least one hash value is required (crc_hash, md5_hash, or sha1_hash)." data = await _get("roms/by-hash", params=params) if not isinstance(data, dict) or "id" not in data: return f"No ROM found matching the provided hash." name = data.get("name", "Unknown") platform = data.get("platform_display_name") or data.get("platform_slug", "?") rom_id = data.get("id", "?") size = data.get("fs_size_bytes", 0) lines = ["Match found:\n"] lines.append(f" {name} [{platform}]") if size: lines.append(f" Size: {_fmt_size(size)}") lines.append(f" ID: {rom_id}") return "\n".join(lines) - server.py:610-610 (registration)The tool is registered using the '@mcp.tool()' decorator on the handler function.
@mcp.tool()