Docs
Dashboard
SDKs / MCP serverBeta

files_delete

Delete a file from the workspace.

Deletes a file in the session's /workspace disk. It cannot be brought back.

Inputs

NameTypeDefaultAllowed valuesDescription
sessionIdrequiredstring––The session's id, from session_create.
pathrequiredstring––The file to delete, relative to /workspace.

sessionId is the id that session_create returned. The server keeps no default session. If that session is stopped, this tool resumes it first, as it was (a resume starts a machine again, and billing with it).

Example call

This is what an MCP client sends. You do not write it yourself: ask the model in plain words and it calls the tool.

tools/call
{  "name": "files_delete",  "arguments": {    "sessionId": "6c1f3c9e-1d2a-4f67-9b0e-1b2c3d4e5f60",    "path": "downloads/old-report.csv"  }}

What it returns

A line that says which path was deleted.

Result
Deleted downloads/old-report.csv.

When a call fails, the result is marked as an error. Its text starts with the API’s error code, such as unauthorized or session_not_running, followed by its message.

Annotations

The server tells every client what this tool does to the world, so a client can decide what to ask you about before it runs.

AnnotationValue
titleDelete a file
readOnlyHintfalse
destructiveHinttrue
openWorldHintfalse

Good to know

  • Deleting is for good: there is no trash. Read the file first if you may want it again.
  • The tool is meant for files. The API route behind it also accepts a folder path.

The same thing with the API

EndpointReference
DELETE /v1/sessions/{id}/filesDelete a file or folder

These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.