Upload a file to F2H
upload_fileUploads a file to the person's F2H account and returns its link (a download page anyone with the link can open). Three ways: (1) content: the file itself, up to 1 MB, as text or base64, when you made it in this conversation and have its bytes (not an image you generated and only showed: you cannot pass that one); it uploads at once. (2) size (and path): for a file on a machine where you can run bash; you get a command that sends it straight to F2H's storage, in 8 MB parts, for files of any size the account allows. (3) neither: when you cannot run commands and the file is the person's, you get the page where they upload it themselves; then call list_my_files. Files expire after expires_in_days, 30 by default; pass another number if the person asks, or 0 to keep it until they delete it. id is the file's id for set_sharing and organize_files, once the file is there. shareText is a ready line with the link, to pass on as it is when the person wants to send it to someone. Pass qr true when a QR code of the link helps (the person wants to open it on their phone or show it to someone nearby, or asks for one) and your app shows images that tools return to the person. Then show the image with a line saying it opens the link when scanned with a phone camera. If your app cannot show it, give the link and do not mention a QR code. Docs: https://f2h.io/en/agents
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qr | No | Also return a QR code image of the link, for opening it on a phone | |
| name | Yes | The file name, with its extension | |
| path | No | The file's absolute path on your machine, to fill in the command (way 2); F2H never reads it | |
| size | No | The file size in bytes, exactly (way 2) | |
| content | No | The file itself, up to 1 MB (way 1) | |
| encoding | No | How content is written: text (UTF-8, the default) or base64 | |
| folder_id | No | The folder to upload into, from an earlier answer; leave it out for the top of the account | |
| expires_in_days | No | Days until the file is deleted; 30 by default, 0 for never |