Meter programs: update, delete
The Meter Verbs update, delete as MCP do programs, with inputs, result, refusals and an example.
Reference for Meter, one group of Meter programs.
Meter.update
Changes the given properties of a Meter. Verb page.
do: return await $.Meter.update(input)Emits Meter.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Meter. |
unit | string | What it counts, such as calls or tokens. | |
of | string | The declared Event the Meter counts. | |
aggregation | string | How counted Events combine over the window: a sum of a value, a count, or the last value. | |
window | string | The period usage accrues over before it bills, such as a month. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
meter | Meter | required | The Meter. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Meter.update({ id: 'mtr_z08Ufi8LwY', unit: 'call' })"
}
}Meter.delete
Deletes a Meter: a soft delete that keeps its history, undone by Thing.restore. Verb page.
do: return await $.Meter.delete(input)Emits Meter.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Meter. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
meter | Meter | required | The Meter. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Meter.delete({ id: 'mtr_z08Ufi8LwY' })"
}
}