# Trigger programs: update, delete

URL: /code/mcp/trigger/records-update · Id: `page:code/mcp/trigger/records-update`

> The Trigger Verbs update, delete as MCP do programs, with inputs, result, refusals and an example.

Reference for [Trigger](/business/nouns/trigger), one group of [Trigger programs](/code/mcp/trigger).

### Trigger.update
Changes the given properties of a Trigger. [Verb page](/business/nouns/trigger/update?interface=mcp).

```text
do: return await $.Trigger.update(input)
```

Emits `Trigger.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Trigger. |
| `event` | `string` | No | The Event selector it matches, such as `Order.placed`. |
| `schedule` | `string` | No | A cadence or cron expression. |
| `where` | `string` | No | The predicate an `event` Trigger matches, such as `choice = 'raise'`. |
| `threshold` | `json` | No | A Metric staying below or above a value, optionally for a while, such as four weeks. |
| `at` | `string` | No | When in its cadence a schedule runs, on the namespace’s clock, such as `mon 09:00`. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `trigger` | [Trigger](/business/nouns/trigger) | Yes | The Trigger. |

**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. | None. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Trigger.update({ id: 'trigger_Hg9n0lrBdP', threshold: {} })"
  }
}
```

### Trigger.delete
Deletes a Trigger: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/trigger/delete?interface=mcp).

```text
do: return await $.Trigger.delete(input)
```

Emits `Trigger.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Trigger. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `trigger` | [Trigger](/business/nouns/trigger) | Yes | The Trigger. |

**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. | None. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Trigger.delete({ id: 'trigger_Hg9n0lrBdP' })"
  }
}
```