Create Style
create_styleCreate a Magic Lane Studio map style from a template ID or full style JSON, returning its summary and version plus warnings for layers that need fixing.
Instructions
Create a Magic Lane Studio style in the account from a template (templateId from list_templates) or from full style JSON, given inline (data) or as the path of a JSON file on this computer (path). Exactly one of the three. To duplicate one of your own styles, get_style it and pass its data (a style id is not accepted as templateId). Returns the new style's summary and version; description, tags and purposes, when given, are applied with a second write. Requires a key with "Studio: Read & write". Not idempotent: two calls with the same name create two styles; after a timeout the tool checks the list before reporting failure. Some templates have layers to fix: the result lists them as warnings, each with its fix or the change to make (checked once per template per hour); fix them with update_style and tell the user what you fixed; if one cannot be fixed or the user keeps it, say so and leave it. Style JSON follows the style format, with its traps (colours are ABGR integers): get_style_reference: the essentials with no arguments (resource magiclane://docs/style-essentials), the full format with page "style-file-format" (https://developer.magiclane.com/docs/guides/map-studio/reference/style-file-format/). Publishing, reverting and deleting styles, previews, thumbnails and privacy settings are Studio actions (https://developer.magiclane.com/studio) and are not available through these tools; a save here only saves.
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": "create_style"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Full style JSON to create the style from. | |
| name | Yes | Style name, 1–100 characters, no line breaks or tabs. | |
| path | No | Path of a style JSON file on this computer, used instead of data, for example a file written by download_style and then edited. Prefer an absolute path: a relative one is taken from the folder MAGICLANE_FILES_DIR names when the server has one, otherwise the server's working directory, which may not be yours. A path that starts with ~/ or ~user/ is refused: ~ is not read as a home folder. | |
| tags | No | Tags: up to 20, each 1–16 characters, no commas; set with a second write after creation. | |
| purposes | No | Purposes, any of browse, navigation-car, navigation-truck, navigation-bike, navigation-pedestrian, satellite, elevation; set with a second write after creation. | |
| templateId | No | Template variation id from list_templates to copy the content from. Must be a template, not one of your styles (to duplicate a style, get_style it and pass its data here instead). | |
| description | No | Description, up to 1000 characters; set with a second write after creation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | The style file the JSON was read from: on the local server only. | |
| notes | Yes | Things to know about this result. | |
| style | Yes | A style, without its JSON. | |
| warnings | No | What to fix in the style. Fix them before saving (or save again), also when they came from a template: apply each "fix", ask the user where askUser is true, make the change the message names where there is neither, and tell the user what you fixed. If one cannot be fixed, or the user keeps it, say so and leave it: warnings never block a save. Only the checks this server makes: an empty list does not mean Studio shows no warning. | |
| takenFromList | No | The answer to the create request was lost, and this style, which has the name and was not in the list before the request, was taken as the new one. Check it with get_style before writing to it. | |
| detailsApplied | Yes | Whether description, tags and purposes were saved too. | |
| warningsTruncated | No | warnings counted but not listed: validate again after fixing the listed ones. |