Get variable
gtm_get_variableRetrieve a Google Tag Manager variable by container and variable ID, including flattened parameters and fingerprint, optionally from a specific workspace.
Instructions
Full variable with flattened parameters (e.g. Data Layer name, JS code) and fingerprint. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached).
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": {
"container": "<container>",
"variable_id": "<variable_id>"
},
"name": "gtm_get_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container | Yes | ||
| variable_id | Yes | ||
| workspace_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||