gtm_template
Manage Google Tag Manager custom templates by creating, retrieving, listing, updating, removing, or reverting them through the API, with pagination for list results.
Instructions
Performs all GTM custom template operations: create, get, list, update, remove, revert. The 'list' action returns up to itemsPerPage items per page.
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": {
"action": "<action>",
"accountId": "<accountId>",
"containerId": "<containerId>",
"workspaceId": "<workspaceId>"
},
"name": "gtm_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (starts from 1). Each page contains up to itemsPerPage items. | |
| action | Yes | The GTM custom template operation to perform. Must be one of: 'create', 'get', 'list', 'update', 'remove', 'revert'. | |
| accountId | Yes | The unique ID of the GTM Account containing the custom template. | |
| templateId | No | The unique ID of the GTM custom template. Required for 'get', 'update', 'remove', and 'revert' actions. | |
| containerId | Yes | The unique ID of the GTM Container containing the custom template. | |
| fingerprint | No | The fingerprint for optimistic concurrency control. Required for 'update' and 'revert' actions. | |
| workspaceId | Yes | The unique ID of the GTM Workspace containing the custom template. | |
| itemsPerPage | No | Number of items to return per page (1-20). Default: 20. Use lower values if experiencing response issues. | |
| createOrUpdateConfig | No | Configuration for 'create' and 'update' actions. All fields correspond to the GTM custom template resource, except IDs. |