Upload a file
upload_artifactUpload a file from base64 content and return its id, its private share link as url, expires_at, size_bytes and secret_flags. The link stops working when the file expires. The decoded file can be up to 25 MiB; for larger files, create_upload_url takes the bytes by PUT instead. The secret scan reads the first 1 MiB of the file, and secret_flags names each kind of secret-shaped content it finds. With on_secret "flag", the default, a flagged file is stored and the result adds a warning and secret_flag_locations. With on_secret "reject", a flagged file is not stored and the call returns the secret_detected error.
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": {
"filename": "<filename>",
"content_base64": "<content_base64>"
},
"name": "upload_artifact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | This is the file name, including its extension, such as screenshot.png. The allowed extensions are png, jpg, jpeg, webp, gif, txt, md, log, json, har and pdf, and the file's contents must match its extension. | |
| ttl_days | No | This is the number of days until the link expires, as a whole number of 1 or more. If you leave it out, the link expires at the plan's maximum, which is 7 days on Free, 90 on Team, 90 on Team Plus and 365 on Scale. A larger value is lowered to the plan's maximum, and the result then includes ttl_adjusted: true. A value of zero or less is rejected. The result's expires_at is the applied expiry. | |
| mime_type | No | The server does not use this value; it takes the file's type from the extension in filename. If you send it, it must be a string. | |
| on_secret | No | The value is either "flag" or "reject", and the default is "flag". With "flag", a file with secret-shaped content is stored, and the result lists secret_flags and adds a warning and secret_flag_locations. With "reject", that file is not stored and the call returns the secret_detected error. | |
| content_base64 | Yes | This is the file's content as standard base64. Line breaks and a data:<mime>;base64, prefix are accepted. The decoded file can be up to 25 MiB. |