gtm_environment
Perform environment operations on Google Tag Manager: create, get, list, update, remove, and reauthorize. Listing supports pagination with up to 50 items per page.
Instructions
Performs all environment operations: create, get, list, update, remove, reauthorize. The 'list' action returns up to 50 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>"
},
"name": "gtm_environment"
}
}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 environment operation to perform. Must be one of: 'create', 'get', 'list', 'update', 'remove', 'reauthorize'. | |
| accountId | Yes | The unique ID of the GTM Account containing the environment. | |
| containerId | Yes | The unique ID of the GTM Container containing the environment. | |
| fingerprint | No | The fingerprint for optimistic concurrency control. Required for 'update' action. | |
| itemsPerPage | No | Number of items to return per page (1-50). Default: 50. Use lower values if experiencing response issues. | |
| environmentId | No | The unique ID of the GTM Environment. Required for 'get', 'update', 'remove', and 'reauthorize' actions. | |
| createOrUpdateConfig | No | Configuration for 'create' and 'update' actions. All fields correspond to the GTM Environment resource, except IDs. |