def list_globals_filter(
    offset: Annotated[int, "Offset to start listing from (start at 0)"],
    count: Annotated[int, "Number of globals to list (100 is a good default, 0 means remainder)"],
    filter: Annotated[str, "Filter to apply to the list (required parameter, empty string for no filter). Case-insensitive contains or /regex/ syntax"],
) -> Page[Global]:
    """List matching globals in the database (paginated, filtered)"""
    globals = []
    for addr, name in idautils.Names():
        # Skip functions
        if not idaapi.get_func(addr):
            globals.append({
                "address": hex(addr),
                "name": name,
            })
    globals = pattern_filter(globals, filter, "name")
    return paginate(globals, offset, count)
List matching globals in the database (paginated, filtered)
src/ida_pro_mcp/mcp-plugin.py