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
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | Annotated[str, Field(description='Name of the Bridge Town project.')] | Yes | — | |
path | Annotated[str, Field(description='Project-relative path of the file to delete.')] | Yes | — | |
commit_message | Annotated[str, Field(description='Git commit message. If omitted, the server generates a default message.')] | No | '' | |
branch | Annotated[str, Field(description="Branch to operate on. Defaults to the project's default branch when omitted or null.")] | No | '' | |
expected_sha | Annotated[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
Section titled “Returns”Returns a structured object. Top-level fields:
path(string)project(string)deleted(boolean)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "delete_file", "arguments": { "project_name": "forecasts", "path": "model/revenue.py", "commit_message": "chore: drop stale revenue model" }}Response
Section titled “Response”{ "path": "model/revenue.py", "project": "forecasts", "deleted": true}- Module:
Models - Requires authentication via API token or Auth0 JWT.