Agent tools

write_storage

write_storage({ storage?, action, … })

Change a connected database or bucket. There is no undo — which is why it is asked even in auto, and why two guards fire before the prompt.

category: storageasked even in autono undo
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

The actions

ActionOn
insert · update · deletea document database
create_collection · drop_collectiona document database
sqla relational database — one statement
put · removea bucket

Two guards before the prompt

RefusedUnless
An empty MongoDB filter, or SQL without WHEREall: true is passed
DROP and drop_collectionThe mode is full access
A guard that fires costs no prompt

The call fails with an explanation the model can act on, and the user is never asked about something that was going to be refused anyway.

It is told to say what it will change

The tool's own description begins with it: there is no undo, so say what you will change before calling. That is the behaviour a permission prompt depends on — the user should already know what they are approving.

« always » is per storage

Approving one storage for the session leaves the others asked. Nothing is written to disk.

put takes a workspace file

write_storage({ action: "put", key: "reports/q3.pdf", path: "Reports/q3.pdf" })
# The call the model makes:
write_storage = {"action": "put", "key": "reports/q3.pdf", "path": "Reports/q3.pdf"}

content for text, path for a file already in the workspace — which is how a generated PDF reaches a bucket without passing through the conversation.