Docs
Dashboard
SDKs / MCP serverBeta

files_write

Write a text file into the workspace.

Creates or replaces a file in /workspace with the text you give.

Inputs

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

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_write",  "arguments": {    "sessionId": "6c1f3c9e-1d2a-4f67-9b0e-1b2c3d4e5f60",    "path": "notes.md",    "content": "# Findings\n"  }}

What it returns

How many bytes were written, and where.

Result
Wrote 11 bytes to /workspace/notes.md.

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
titleWrite a file
readOnlyHintfalse
destructiveHinttrue
openWorldHintfalse

The same thing with the API

EndpointReference
PUT /v1/sessions/{id}/filesUpload a file

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