Add a file to a site draft
site_put_filePuts one file into a site draft (draftId from site_draft): path is relative to the site's root (index.html, assets/app.js); no leading "/"; no empty, "." or ".." parts; letters, digits and . _ - ~ only (also ! $ & ' ( ) * + , ; = : @) — no spaces, ?, #, % or backslashes; at most 300 characters; not under __gemmein/ (Gemmein's own); a secret-shaped file or a dot-file (.env .env.* *.env *.pem .key .p12 .pfx id_rsa id_ed25519 .npmrc .git/ .) is refused; content is the file's text, or base64 with encoding "base64" for an image or a font. A file already in the draft at that path is replaced; site_read returns the current contents of a file to change before it is put back. One file per call, and one call carries up to 1 MB (a base64 file up to about 750 KB); a bigger file goes through npx gemmein publish from a computer. A site holds up to 2,000 files and 50 MiB. Nothing is served until site_publish.
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": {
"draftId": "<draftId>",
"path": "<path>",
"content": "<content>"
},
"name": "site_put_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | relative to the site's root, like index.html or assets/app.js | |
| content | Yes | the file's text, or base64 with encoding "base64" | |
| draftId | Yes | ||
| encoding | No | default text | |
| contentType | No | optional — read from the extension when left out |