---
name: omni-navigate
description: Navigate to the next or previous page of search results in OCUL Omni, or jump to a specific page number. Use this after omni-search when the user wants to see more results beyond the first 10.
---

# Omni Navigate Pages

Paginate through Omni search results by modifying the `offset` parameter in the URL.

## How Primo Pagination Works

Primo uses URL-based pagination via the `offset` parameter:
- Page 1: `offset=0`
- Page 2: `offset=10`
- Page 3: `offset=20`
- Page N: `offset=(N-1)*10`

## Steps

### Step 1: Determine Current URL and Target Offset

Get the current page URL:

```javascript
() => ({
  currentUrl: window.location.href,
  currentOffset: new URLSearchParams(window.location.search).get('offset') || '0'
})
```

Calculate the new offset based on user request:
- "next page": `currentOffset + 10`
- "previous page": `currentOffset - 10` (minimum 0)
- "page N": `(N - 1) * 10`

### Step 2: Navigate to New Page

Replace the `offset` value in the current URL and navigate:

```javascript
() => {
  const url = new URL(window.location.href);
  url.searchParams.set('offset', '{NEW_OFFSET}');
  window.location.href = url.toString();
}
```

### Step 3: Extract Results

After navigation, wait 3 seconds and extract results using the same script as omni-search Step 2.

## Notes

- If the current URL does not contain a search query (i.e. user navigated away), ask the user to run omni-search first
- Minimum offset is 0 (cannot go before page 1)
- If a page returns 0 results, the user has gone past the last page

