Skip to content

Variant programs: update, delete

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

Reference for Variant, one group of Variant programs.

Variant.update

Changes the given properties of a Variant. Verb page.

Text
do: return await $.Variant.update(input)

Emits Variant.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Variant.
keystringThe name the Flag returns for it.
valuejsonWhat it changes: copy, behavior, a definition Version, or a Thing.
controlbooleanTrue for the current definition every challenger is judged against.
followsVariantThe Variant it was drafted from by a learn step.

Returns

OutputTypeRequiredDescription
variantVariantrequiredThe Variant.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse 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 $.Variant.update({ id: 'variant_nvdfmt7dTw', value: {} })"
  }
}

Variant.delete

Deletes a Variant: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
do: return await $.Variant.delete(input)

Emits Variant.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Variant.

Returns

OutputTypeRequiredDescription
variantVariantrequiredThe Variant.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse 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 $.Variant.delete({ id: 'variant_nvdfmt7dTw' })"
  }
}