Skip to content

delete_file

Delete a file from a Bridge Town project. The path is project-relative (e.g. ‘README.md’, ‘model/revenue.py’, ‘data/seed.csv’, ‘assets/logo.png’). Specify branch to delete from a non-default branch (e.g. a scenario branch). Defaults to the project’s default branch when branch is omitted. Pass expected_sha (the sha returned by read_file) to enable optimistic concurrency control: if another session modified the file since you last read it the tool raises a ToolError with the current SHA. Requires at least Editor access to the project. Returns: path (str) — deleted file path; project (str) — project name; deleted (bool) — always true on success.

destructive

NameTypeRequiredDefaultDescription
project_namestrYes
pathstrYes
commit_messagestrNo''
branchstrNo''
expected_shastrNo''

Returns a structured object. Top-level fields:

  • path (string)
  • project (string)
  • deleted (boolean)

See the response example below for the full payload shape.

{
"name": "delete_file",
"arguments": {
"project_name": "forecasts",
"path": "model/revenue.py",
"commit_message": "chore: drop deprecated revenue model"
}
}
{
"path": "model/revenue.py",
"project": "forecasts",
"deleted": true
}
  • Module: Models
  • Requires authentication via API token or Auth0 JWT.