common-set-item-template-by-id
Change the template of a Sitecore content item by specifying its ID, enabling content restructuring while optionally mapping field values between templates.
Instructions
Sets the item template by the item's ID.
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>",
"template": "<template>"
},
"name": "common-set-item-template-by-id"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the item to set the template for. | |
| template | Yes | The path representing the template item. | |
| fieldsToCopy | No | The key-value pairs map the old template fields to the new template fields. The key represents the old template field, and the value represents the new template field. | |
| database | No | The database containing the item (defaults to the context database). |