# browser.eval

Evaluates a JavaScript expression in the inspected page (MAIN world) and returns the JSON-serialisable result. An expression that yields nothing returns null; one that throws, or yields a value that cannot be serialised (a DOM node, a function, a circular object), is a PAGE_ERROR naming the reason — so a null result always means the page really produced null. Return a projection of what you need rather than a live object. Runs in the TOP frame by default — unlike the pixi.* tools, this one does not rank frames. On a multi-frame game pass frameId (from a pixi.* result's target line) to evaluate inside the frame that owns the game; the result's target line reports the frame it ran in.

Agent View of the PolicyLayer registry record for `browser.eval`. HTML page: https://policylayer.com/tools/pixi-inspector-mcp/browser.eval

## Facts

- Tool: `browser.eval`
- Server: Pixi Inspector (`pixi-inspector-mcp`) — https://policylayer.com/tools/pixi-inspector-mcp.md
- Install: `npx -y pixi-inspector-mcp`
- Homepage: https://www.npmjs.com/package/pixi-inspector-mcp
- Risk category: Other (Low risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 4 (1 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `tabId` | integer | no | Legacy: a bare tab id, resolved inside the browser this session is already working with. Prefer `target`, which is unambiguous across browsers. |
| `target` | string | no | Drive a specific tab: a target id like "b7a3c1#487" from status/use_target/CHOOSE_TARGET. Omit to use this session's chosen tab (or the only available one). Pas |
| `frameId` | integer | no | Escape hatch: drive a specific FRAME of the tab (0 is the top frame). Normally unnecessary — the extension picks the frame running the game (canvas owner first, |
| `expression` | string | yes | JavaScript expression to evaluate |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "browser.eval",
    "arguments": {
      "expression": "<expression>"
    }
  }
}
```

## Why browser.eval is rated Low

Without any rule in front of it, every call an agent makes to browser.eval happens silently: no trail, no cap, no way to know it misbehaved until something breaks downstream.

Risk signals: Accepts freeform code/query input (expression)

## Use case

AI agents call browser.eval as a supporting operation in Pixi Inspector workflows.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Pixi Inspector:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "browser.eval": {
      "limits": [
        {
          "counter": "browser.eval_rate",
          "window": "minute",
          "max": 60,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Pixi Inspector (62)

- `cdp.console.start` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.console.start.md
- `cdp.emulate.cpu` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.emulate.cpu.md
- `cdp.emulate.device` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.emulate.device.md
- `cdp.emulate.network` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.emulate.network.md
- `cdp.emulate.touch` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.emulate.touch.md
- `cdp.network.start` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.network.start.md
- `cdp.network.stop` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.network.stop.md
- `cdp.performance.trace.start` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/cdp.performance.trace.start.md
- `ext.logs` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/ext.logs.md
- `pixi.tree.highlight` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/pixi.tree.highlight.md
- `use_target` — Destructive — https://policylayer.com/tools/pixi-inspector-mcp/use-target.md
- `cdp.console.list` — Execute — https://policylayer.com/tools/pixi-inspector-mcp/cdp.console.list.md
- `cdp.network.list` — Execute — https://policylayer.com/tools/pixi-inspector-mcp/cdp.network.list.md
- `pixi.stats` — Execute — https://policylayer.com/tools/pixi-inspector-mcp/pixi.stats.md
- `browser.navigate` — Other — https://policylayer.com/tools/pixi-inspector-mcp/browser.navigate.md
- `browser.reload` — Other — https://policylayer.com/tools/pixi-inspector-mcp/browser.reload.md
- `browser.screenshot` — Other — https://policylayer.com/tools/pixi-inspector-mcp/browser.screenshot.md
- `cdp.console.stop` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.console.stop.md
- `cdp.dom.getAttributes` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.getattributes.md
- `cdp.dom.getBoxModel` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.getboxmodel.md
- `cdp.dom.query` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.query.md
- `cdp.dom.removeNode` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.removenode.md
- `cdp.dom.setAttribute` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.setattribute.md
- `cdp.dom.setOuterHTML` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.setouterhtml.md
- `cdp.dom.snapshot` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.dom.snapshot.md
- `cdp.emulate.clear` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.emulate.clear.md
- `cdp.input.click` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.input.click.md
- `cdp.input.key` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.input.key.md
- `cdp.input.move` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.input.move.md
- `cdp.input.scroll` — Other — https://policylayer.com/tools/pixi-inspector-mcp/cdp.input.scroll.md
- …and 32 more: https://policylayer.com/tools/pixi-inspector-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=pixi-inspector-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/pixi-inspector-mcp
