# preview_open

Needs http. A secret 10-minute link to see a preview in your own browser.

**In short:** A [server tool](https://docs.cmdop.ai/reference/tools.md#server-tools): the server answers it from its own record, so it works while every machine is off. Over MCP call `preview_open`; over HTTP send `"tool": "preview_open"` to [`POST /api/v1/call`](https://docs.cmdop.ai/reference/http/post-call.md) without `machine`.

## Arguments

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `name` | `string` | yes | The preview's name, as `previews_list` shows it. |

## Result

| Name | Type | Required | Meaning |
| --- | --- | --- | --- |
| `expires` | `integer` | no | When the link stops opening (unix seconds); absent for a public preview's own address. |
| `url` | `string` | yes | Open it in your own browser. A private preview's link is one-time: it signs that browser in to this preview as you, works up to 3 times within 10 minutes, and is a secret. |

## Examples

**MCP**

```json
{
  "name": "preview_open",
  "arguments": {
    "name": "<name>"
  }
}
```

**HTTP**

```bash
curl -sS -X POST "https://<contour>.cmdop.dev/api/v1/call" \
  -H "Authorization: Bearer $CMDOP_TOKEN" \
  -H "x-cmdop: 1" \
  -H "Content-Type: application/json" \
  -d '{"tool":"preview_open","args":{"name":"<name>"}}'
```

## Limits

The token is the only check: no risk class applies, and the call is not counted against the plan. A call with `machine` set, or with `sealed` instead of `args`, returns [`bad_args`](https://docs.cmdop.ai/reference/errors/bad_args.md). A refused call returns one of the [error codes](https://docs.cmdop.ai/reference/errors.md).
