# Instrument programs: cancel, convert, exercise

URL: /code/mcp/instrument/verbs · Id: `page:code/mcp/instrument/verbs`

> The Instrument Verbs cancel, convert, exercise as MCP do programs, with inputs, result, refusals and an example.

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

### Instrument.cancel
Cancel ends an unvested, expired or forfeited Instrument and returns any option Shares to the pool. [Verb page](/business/nouns/instrument/cancel?interface=mcp).

```text
do: return await $.Instrument.cancel(input)
```

Emits [`Instrument.canceled`](/business/events/Instrument.canceled).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `instrument` | [Instrument](/business/nouns/instrument) | Yes | The Instrument to end. |
| `reason` | `string` | Yes | Why it ends: `unvested`, `expired` or `forfeited`. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `instrument` | [Instrument](/business/nouns/instrument) | Yes | The canceled Instrument, kept with its history. |

**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 $.Instrument.cancel({ instrument: 'instrument_yZz4i2meOW', reason: 'unvested' })"
  }
}
```

### Instrument.convert
Convert turns a SAFE or note into Shares at a priced round, at its cap or discount, whichever gives more Shares. [Verb page](/business/nouns/instrument/convert?interface=mcp).

```text
do: return await $.Instrument.convert(input)
```

Emits [`Instrument.converted`](/business/events/Instrument.converted).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `instrument` | [Instrument](/business/nouns/instrument) | Yes | The SAFE or note. |
| `roundPrice` | `money` | Yes | The price per Share of the priced round. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `shares` | list of [Share](/business/nouns/share) | Yes | The Shares issued on conversion. |
| `instrument` | [Instrument](/business/nouns/instrument) | Yes | The Instrument, now converted. |

**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 $.Instrument.convert({ instrument: 'instrument_yZz4i2meOW', roundPrice: { amount: 29, currency: 'USD' } })"
  }
}
```

### Instrument.exercise
Exercise buys the Shares an option or warrant covers at its strike price, up to what has vested. [Verb page](/business/nouns/instrument/exercise?interface=mcp).

```text
do: return await $.Instrument.exercise(input)
```

Emits [`Instrument.exercised`](/business/events/Instrument.exercised).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `instrument` | [Instrument](/business/nouns/instrument) | Yes | The option or warrant. |
| `quantity` | `integer` | Yes | How many Shares to buy. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `share` | [Share](/business/nouns/share) | Yes | The Shares bought. |
| `instrument` | [Instrument](/business/nouns/instrument) | Yes | The Instrument, now exercised. |

**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 $.Instrument.exercise({ instrument: 'instrument_yZz4i2meOW', quantity: 1 })"
  }
}
```