Skip to content

remove_element

Remove an Element · destructive · write tool

Removes an Element and the Relationships declared under it. Refused while anything still references it (an Element in it, a Relationship to or via it, a Deployment of it, an ADR linking it), with each reference’s file:line; nothing cascades.

Field Type Required Notes
project string yes The Project to edit, by id.
id string yes An id in this Project (bare), or project:id.
dry_run boolean Check the write and return its diff without changing any file. Default: false.
Field Type Required Notes
action "created" or "updated" or "removed" or "unchanged" yes
id string or null yes The qualified id written (bare for a Team, Environment or Project); null for a Deployment, or a Relationship without one.
from string
to string
service string
environment string
target string
files list of string yes
diff string yes
dryRun boolean yes

Called over the Kitchen sink example Workspace.

Arguments:

{
"project": "sink",
"id": "catalogue",
"dry_run": true
}

Result:

{
"action": "removed",
"id": "sink:catalogue",
"files": [
"examples/kitchen-sink/archidocs/sink/model.yaml"
],
"dryRun": true,
"diff": "(the patch below)"
}

The diff, as a patch:

--- a/examples/kitchen-sink/archidocs/sink/model.yaml
+++ b/examples/kitchen-sink/archidocs/sink/model.yaml
@@ -52,13 +52,6 @@
- to: payment-gateway
description: Charges cards through
technology: HTTPS
- catalogue:
- name: Catalog
- technology: TypeScript module
- relationships:
- - to: search
- description: Searches with
- technology: HTTPS
orders-db:
name: Orders DB
description: A datastore Service.
@@ -101,4 +94,5 @@
external: true
technology: Stripe API
owner: edge
+
#endregion

A call that fails returns isError: true, with {code, message, suggestions?} as structuredContent. This tool returns:

  • invalid_input when the arguments don’t fit the input above.
  • not_found when the Project, or an id it names, matches nothing.
  • validation_failed when the write would add a check error. Nothing is written.
  • read_only when the server reads a published Workspace Bundle, or serves HTTP without --allow-writes.
  • source_unavailable when the server can’t read the Workspace.

Error codes says what to do about each.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.