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.

destructive

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
pathAnnotated[str, Field(description='Project-relative path of the file to delete.')]Yes
commit_messageAnnotated[str, Field(description='Git commit message. If omitted, the server generates a default message.')]No''
branchAnnotated[str, Field(description="Branch to operate on. Defaults to the project's default branch when omitted or null.")]No''
expected_shaAnnotated[str, Field(description='Expected blob SHA-1 (40 hex chars) for optimistic concurrency control. If the file has been modified since you last read it, the call fails with a conflict error. Read the file first to get its current sha.')]No''

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 stale revenue model"
}
}
{
"path": "model/revenue.py",
"project": "forecasts",
"deleted": true
}
  • Module: Models
  • Requires authentication via API token or Auth0 JWT.