Attach a file to a document
add_attachmentAttaches one file to a document already on HTMLRadar, for readers of its links to download. The file types are the website's (PDF, Office documents, images, CSV, text, Markdown, ZIP) and a document holds up to 20 files. The file travels as base64 in content_base64, because a tool argument is JSON, so it can be at most 5.0 MB, the same limit as publishing a page this way; a larger file (the website takes 25 MB) is added on the website. Readers see the file from the next time they load the page. There is no file-path argument.
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": {
"document_id": "<document_id>",
"filename": "<filename>",
"content_base64": "<content_base64>"
},
"name": "add_attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | The file name with its extension, e.g. "pricing.pdf". The extension decides the type. | |
| document_id | Yes | The document: the document id from list_documents or list_shares. | |
| content_base64 | Yes | The file's contents, base64-encoded. |