# Purpose programs: update, delete

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

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

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

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

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

Emits `Purpose.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Purpose. |
| `name` | `string` | No | The reason, such as marketing email or call recording. |

**Returns**

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

**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 $.Purpose.update({ id: 'purpose_Aoz9nBatRR', name: 'Leaseline' })"
  }
}
```

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

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

Emits `Purpose.deleted`.

**Inputs**

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

**Returns**

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

**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 $.Purpose.delete({ id: 'purpose_Aoz9nBatRR' })"
  }
}
```