Preview creating a map layer
tiled_create_layerCreate an empty tile, object, image, or group layer in a Tiled map at a given index, pinning revisions for a safe, expiring change set without modifying project assets.
Instructions
Plans one empty tile, object, image or group layer at a root/group insertion index, pins map/dependency revisions, and returns an expiring change set without modifying project assets. Image layers require imagePath and may pin expectedImageRevision; other layer types reject both image fields.
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": {
"mapPath": "<mapPath>",
"name": "<name>",
"expectedMapRevision": "<expectedMapRevision>",
"expectedDependencyRevisions": "<expectedDependencyRevisions>",
"type": "<type>"
},
"name": "tiled_create_layer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| type | Yes | Layer kind. imagelayer requires imagePath; all other kinds forbid imagePath and expectedImageRevision. | |
| index | No | ||
| mapPath | Yes | Canonical project-relative POSIX path; absolute paths and .. are forbidden | |
| imagePath | No | Project-relative image path. Required only when type is imagelayer. | |
| parentGroupId | No | ||
| expectedMapRevision | Yes | SHA-256 revision returned by a read or preview | |
| expectedImageRevision | No | Optional current image revision pin. Allowed only when type is imagelayer. | |
| expectedDependencyRevisions | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |