Download Style
download_styleDownload a Magic Lane Studio map style as a JSON file or as a .style file the SDK loads, writing it to disk and replacing an existing file only when overwrite is set.
Instructions
Download a Magic Lane Studio style as a file: format "json" (the style JSON, byte-for-byte the "data" of get_style) or "proto" (the .style file the Magic Lane SDK loads, which the portal builds on request in about a second). Give a path to write the file to disk — required in practice for "proto", which is otherwise returned base64-encoded only when small. The file is new: an existing one is replaced only with overwrite: true. The download reflects the last saved content whether or not the style was published in Studio. When the portal cannot build the .style file, the result carries what it reported, which says what to fix.
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": {
"id": "<id>"
},
"name": "download_style"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Style or template id (UUID). | |
| path | No | File path to write the download to, absolute or relative to the folder MAGICLANE_FILES_DIR names when the server has one, otherwise the server's working directory, ending in ".json" for "json" and in ".style" for "proto". Recommended for "proto"; without a path a binary is returned base64-encoded only when it is small. The file is new: an existing one is replaced only with overwrite: true. A network path is refused, and so are a name other programs run commands from (such as package.json or kernel.json), any folder or file that starts with a dot, the folders where programs keep their settings (~/Library on macOS, AppData and ProgramData on Windows), and a name holding a character that shows as nothing. A path that starts with ~/ or ~user/ is refused: ~ is not read as a home folder. | |
| format | No | "json": the style JSON file (identical to get_style data). "proto": the .style file the Magic Lane SDK loads; the portal builds it on request in about a second, and when it cannot, the error says why. | json |
| overwrite | No | Replace the file at path if it exists. Default false: an existing file is refused. Set it only when the user wants that file replaced, for example to download again a style file you downloaded before. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Style id. | |
| data | No | The style JSON, for a json download without a path. | |
| note | Yes | Things to know about this result. | |
| path | No | Absolute path the download was written to: on the local server only. | |
| bytes | Yes | Size of the download. | |
| base64 | No | The .style file, base64-encoded, for a small proto download without a path. | |
| format | Yes | "json": the style JSON; "proto": the .style file. | |
| filename | No | File name the portal suggested. | |
| contentType | Yes | Content type the portal sent. |