# watch

URL: /business/nouns/metric/watch · Id: `verb:Metric.watch` · Call: `await $.Metric.watch({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Watch alerts the owner of a Metric when it crosses a threshold, by a Task or a Message.

[Watch](/business/nouns/watch) alerts the owner of a [Metric](/business/nouns/metric) when it crosses a threshold, by a [Task](/business/nouns/task) or a [Message](/business/nouns/message).

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `metric` | [Metric](/business/nouns/metric) | Yes | The Metric to watch. |
| `threshold` | `number` | Yes | The value that trips it. |
| `direction` | `string` | Yes | Trip when the Metric goes above or below the threshold. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `watch` | [Watch](/business/nouns/watch) | Yes | The Watch that checks it. |
| `metric` | [Metric](/business/nouns/metric) | Yes | The Metric now watched. |

## Effects
- Emits [`Metric.watched`](/business/events/Metric.watched).
- Performed by the [Analyst](/agents/marketing/analyst).
- Two-way: it runs at once, in the `try`, `send` and `do` modes.
- A guardrail Metric that trips stops its Experiment at once, with no delay window.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | [Metric.watch](/business/nouns/metric/watch) |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Low: two-way, nothing at stake |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | None: it runs once review passes. |
| Limit | The call [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Watch the latest metric.
```

**API**

```bash
curl -X POST https://api.sb/patentpad.com/metrics/metric_1/watch \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"threshold":1,"direction":"above"}'
```

```json
{
  "api": "https://api.sb/patentpad.com",
  "watch": {
    "$id": "https://api.sb/patentpad.com/watches/watch_1",
    "$type": "Watch",
    "selector": "Example selector",
    "url": "https://patentpad.com"
  },
  "metric": {
    "$id": "https://api.sb/patentpad.com/metrics/metric_1",
    "$type": "Metric",
    "query": "Example query",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/patentpad.com/actions/action_1",
    "operation": "Metric.watch",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/patentpad.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const { watch, metric } = await $.Metric.watch({ metric: 'metric_1', threshold: 1, direction: 'above' })
```

**CLI**

```bash
npx startup-builder do Metric.watch --json '{"metric":"metric_1","threshold":1,"direction":"above"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Metric.watch({ metric: 'metric_1', threshold: 1, direction: 'above' })"
  }
}
```