Skip to content

remove_data_source

Detach a data source, or delete one of its snapshot generations (bt-p1opf.8: merges the former detach_data_source and delete_data_source_snapshot tools; action selects the behavior). Requires at least Editor role. action=‘detach’: disconnect the source from future model runs (soft-delete; retained for lineage). Referenced snapshots stay retained and listable via list_data_sources(include_snapshots=true); unreferenced ones become eligible for cleanup.

destructive

NameTypeRequiredDefaultDescription
model_nameAnnotated[str, Field(description='Name of the Bridge Town model.')]Yes
data_source_idAnnotated[str, Field(description='Data source ID, as returned by list_data_sources.')]Yes
actionAnnotated[str, Field(description="'detach' to disconnect the source from future runs (soft-delete; dry-run/confirmation-token gated), or 'delete_snapshot' to delete one specific, unreferenced, non-current snapshot generation (requires snapshot_id).")]Yes
snapshot_idAnnotated[str, Field(description="Opaque snapshot ID, as returned by list_data_sources(include_snapshots=true). Required when action='delete_snapshot'; ignored otherwise.")]No''
dry_runAnnotated[bool, Field(description="Preview the detach without mutating anything. Only applies to action='detach'.")]NoTrue
confirmation_token`Annotated[strNone, Field(description=“Token required to confirm the detach (returned by a dry run). Only applies to action=‘detach’.”)]`NoNone
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

Returns a structured object. Top-level fields:

  • model_name (string)
  • data_source_id (string)
  • action (string)
  • source_name (string)
  • source_type (string)
  • detached (boolean)
  • already_detached (boolean)
  • dry_run (boolean)
  • confirmation_token (string)
  • message (string)
  • workspace_id (string)

See the response example below for the full payload shape.

{
"name": "remove_data_source",
"arguments": {
"model_name": "forecasts",
"data_source_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78",
"action": "detach"
}
}
{
"model_name": "forecasts",
"data_source_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78",
"action": "detach",
"source_name": "budget_inputs",
"source_type": "file_upload",
"detached": false,
"already_detached": false,
"dry_run": true,
"confirmation_token": "eyJleHAiOjE3ODAwMDAwMDB9.6f2c...",
"message": "Dry run: data source 'budget_inputs' would be detached from 'forecasts'. Pass dry_run=False with confirmation_token to execute.",
"workspace_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78"
}
  • Module: Data
  • Requires authentication via API token or Auth0 JWT.