MCP
Google Tag Manager MCPTool documentation
23 tool calls, their inputs and the limits of this connection. Implementation snapshot: 8 October 2026.
The complete tool reference.
11 read tools and 12 write tools. Open a tool to see its parameters and full JSON Schema. Unknown fields are rejected.
gtm_list_containersList selected containersRead
gtm_list_containersList selected containersList only containers selected for this grant; discover accounts and containers in the Portal.
Input parameters
No parameters. Pass an empty object: {}.
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {},
"additionalProperties": false
}gtm_get_containerGet containerRead
gtm_get_containerGet containerRead one selected container.
Input parameters
resource_keyRequired- string · Max. characters: 200
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
}
},
"required": [
"resource_key"
],
"additionalProperties": false
}gtm_list_workspacesList workspacesRead
gtm_list_workspacesList workspacesRead one page of workspaces in the selected container.
Input parameters
resource_keyRequired- string · Max. characters: 200
page_tokenOptional- string · Max. characters: 4096
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"page_token": {
"type": "string",
"maxLength": 4096
}
},
"required": [
"resource_key"
],
"additionalProperties": false
}gtm_get_workspaceGet workspaceRead
gtm_get_workspaceGet workspaceRead workspace data including its current fingerprint.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"resource_key",
"workspace_id"
],
"additionalProperties": false
}gtm_get_workspace_statusGet workspace statusRead
gtm_get_workspace_statusGet workspace statusRead modified/conflicting workspace entities. Does not sync, version or publish.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"resource_key",
"workspace_id"
],
"additionalProperties": false
}gtm_create_workspaceCreate workspaceWrite
gtm_create_workspaceCreate workspaceCreate an unpublished workspace. Requires explicit user intent and a unique operation_id.
Input parameters
resource_keyRequired- string · Max. characters: 200
operation_idRequired- string · uuid
nameRequired- string · Min. characters: 1 · Max. characters: 256
descriptionOptional- string · Max. characters: 2000
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"description": {
"type": "string",
"maxLength": 2000
}
},
"required": [
"resource_key",
"operation_id",
"name"
],
"additionalProperties": false
}gtm_update_workspaceUpdate workspaceWrite
gtm_update_workspaceUpdate workspaceRead current workspace first, preserve omitted fields, then update name/description with the native atomic fingerprint check. Does not publish.
Fresh read before the change: gtm_get_workspace.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
nameRequired- string · Min. characters: 1 · Max. characters: 256
descriptionOptional- string · Max. characters: 2000
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"description": {
"type": "string",
"maxLength": 2000
}
},
"required": [
"resource_key",
"workspace_id",
"operation_id",
"fingerprint",
"name"
],
"additionalProperties": false
}gtm_delete_workspaceDelete workspaceWrite
gtm_delete_workspaceDelete workspaceDelete this workspace and its unpublished changes. Fingerprint is checked in a fresh separately authorized read first. Google DELETE has no atomic fingerprint comparison, so a concurrent edit can still race. Does not publish the container. Requires explicit user intent.
Changes existing configuration or campaign status. Requires explicit user intent.
Fresh read before the change: gtm_get_workspace.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"resource_key",
"workspace_id",
"operation_id",
"fingerprint"
],
"additionalProperties": false
}gtm_get_tagGet tagRead
gtm_get_tagGet tagRead one workspace tag and its fingerprint.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id"
],
"additionalProperties": false
}gtm_create_tagCreate tagWrite
gtm_create_tagCreate tagCreate an unpublished workspace tag. Requires explicit user intent; never publishes.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
bodyRequired- object · Required inside object: name, type
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"type": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9_]+$"
},
"notes": {
"type": "string",
"maxLength": 2000
},
"parameter": {
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "list"
},
"list": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"list"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "map"
},
"map": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"map"
],
"additionalProperties": false
}
]
}
},
"firingTriggerId": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"blockingTriggerId": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"paused": {
"type": "boolean"
},
"tagFiringOption": {
"type": "string",
"enum": [
"unlimited",
"oncePerEvent",
"oncePerLoad"
]
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"required": [
"resource_key",
"workspace_id",
"operation_id",
"body"
],
"additionalProperties": false
}gtm_update_tagUpdate tagWrite
gtm_update_tagUpdate tagRead the current tag, preserve other fields and apply the supplied edits using an atomic fingerprint check. Never publishes.
Fresh read before the change: gtm_get_tag.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
bodyRequired- object · Required inside object: name, type
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"type": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9_]+$"
},
"notes": {
"type": "string",
"maxLength": 2000
},
"parameter": {
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "list"
},
"list": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"list"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "map"
},
"map": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"map"
],
"additionalProperties": false
}
]
}
},
"firingTriggerId": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"blockingTriggerId": {
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"paused": {
"type": "boolean"
},
"tagFiringOption": {
"type": "string",
"enum": [
"unlimited",
"oncePerEvent",
"oncePerLoad"
]
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id",
"operation_id",
"fingerprint",
"body"
],
"additionalProperties": false
}gtm_delete_tagDelete tagWrite
gtm_delete_tagDelete tagDelete an unpublished workspace tag. Fingerprint is checked in a fresh separately authorized read first. Google DELETE has no atomic fingerprint comparison, so a concurrent edit can still race. Does not publish the container. Requires explicit user intent.
Changes existing configuration or campaign status. Requires explicit user intent.
Fresh read before the change: gtm_get_tag.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id",
"operation_id",
"fingerprint"
],
"additionalProperties": false
}gtm_list_triggersList triggersRead
gtm_list_triggersList triggersRead one page of workspace triggers.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
page_tokenOptional- string · Max. characters: 4096
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"page_token": {
"type": "string",
"maxLength": 4096
}
},
"required": [
"resource_key",
"workspace_id"
],
"additionalProperties": false
}gtm_get_triggerGet triggerRead
gtm_get_triggerGet triggerRead one workspace trigger and its fingerprint.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id"
],
"additionalProperties": false
}gtm_create_triggerCreate triggerWrite
gtm_create_triggerCreate triggerCreate an unpublished workspace trigger. Requires explicit user intent; never publishes.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
bodyRequired- object · Required inside object: name, type
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"type": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9_]+$"
},
"notes": {
"type": "string",
"maxLength": 2000
},
"parameter": {
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "list"
},
"list": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"list"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "map"
},
"map": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"map"
],
"additionalProperties": false
}
]
}
},
"customEventFilter": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"equals",
"contains",
"startsWith",
"endsWith",
"matchRegex",
"greater",
"greaterOrEquals",
"less",
"lessOrEquals",
"cssSelector",
"urlMatches"
]
},
"parameter": {
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"parameter"
],
"additionalProperties": false
}
},
"filter": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"equals",
"contains",
"startsWith",
"endsWith",
"matchRegex",
"greater",
"greaterOrEquals",
"less",
"lessOrEquals",
"cssSelector",
"urlMatches"
]
},
"parameter": {
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"parameter"
],
"additionalProperties": false
}
},
"autoEventFilter": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"equals",
"contains",
"startsWith",
"endsWith",
"matchRegex",
"greater",
"greaterOrEquals",
"less",
"lessOrEquals",
"cssSelector",
"urlMatches"
]
},
"parameter": {
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"parameter"
],
"additionalProperties": false
}
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"required": [
"resource_key",
"workspace_id",
"operation_id",
"body"
],
"additionalProperties": false
}gtm_update_triggerUpdate triggerWrite
gtm_update_triggerUpdate triggerRead the current trigger, preserve other fields and apply the supplied edits using an atomic fingerprint check. Never publishes.
Fresh read before the change: gtm_get_trigger.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
bodyRequired- object · Required inside object: name, type
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"type": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9_]+$"
},
"notes": {
"type": "string",
"maxLength": 2000
},
"parameter": {
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "list"
},
"list": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"list"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "map"
},
"map": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"map"
],
"additionalProperties": false
}
]
}
},
"customEventFilter": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"equals",
"contains",
"startsWith",
"endsWith",
"matchRegex",
"greater",
"greaterOrEquals",
"less",
"lessOrEquals",
"cssSelector",
"urlMatches"
]
},
"parameter": {
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"parameter"
],
"additionalProperties": false
}
},
"filter": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"equals",
"contains",
"startsWith",
"endsWith",
"matchRegex",
"greater",
"greaterOrEquals",
"less",
"lessOrEquals",
"cssSelector",
"urlMatches"
]
},
"parameter": {
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"parameter"
],
"additionalProperties": false
}
},
"autoEventFilter": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"equals",
"contains",
"startsWith",
"endsWith",
"matchRegex",
"greater",
"greaterOrEquals",
"less",
"lessOrEquals",
"cssSelector",
"urlMatches"
]
},
"parameter": {
"maxItems": 10,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"parameter"
],
"additionalProperties": false
}
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id",
"operation_id",
"fingerprint",
"body"
],
"additionalProperties": false
}gtm_delete_triggerDelete triggerWrite
gtm_delete_triggerDelete triggerDelete an unpublished workspace trigger. Fingerprint is checked in a fresh separately authorized read first. Google DELETE has no atomic fingerprint comparison, so a concurrent edit can still race. Does not publish the container. Requires explicit user intent.
Changes existing configuration or campaign status. Requires explicit user intent.
Fresh read before the change: gtm_get_trigger.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id",
"operation_id",
"fingerprint"
],
"additionalProperties": false
}gtm_list_variablesList variablesRead
gtm_list_variablesList variablesRead one page of workspace variables.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
page_tokenOptional- string · Max. characters: 4096
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"page_token": {
"type": "string",
"maxLength": 4096
}
},
"required": [
"resource_key",
"workspace_id"
],
"additionalProperties": false
}gtm_get_variableGet variableRead
gtm_get_variableGet variableRead one workspace variable and its fingerprint.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id"
],
"additionalProperties": false
}gtm_create_variableCreate variableWrite
gtm_create_variableCreate variableCreate an unpublished workspace variable. Requires explicit user intent; never publishes.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
bodyRequired- object · Required inside object: name, type
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"type": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9_]+$"
},
"notes": {
"type": "string",
"maxLength": 2000
},
"parameter": {
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "list"
},
"list": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"list"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "map"
},
"map": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"map"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"required": [
"resource_key",
"workspace_id",
"operation_id",
"body"
],
"additionalProperties": false
}gtm_update_variableUpdate variableWrite
gtm_update_variableUpdate variableRead the current variable, preserve other fields and apply the supplied edits using an atomic fingerprint check. Never publishes.
Fresh read before the change: gtm_get_variable.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
bodyRequired- object · Required inside object: name, type
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"body": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"type": {
"type": "string",
"maxLength": 100,
"pattern": "^[A-Za-z0-9_]+$"
},
"notes": {
"type": "string",
"maxLength": 2000
},
"parameter": {
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "list"
},
"list": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"list"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"const": "map"
},
"map": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 200
},
"type": {
"type": "string",
"enum": [
"template",
"integer",
"boolean",
"tagReference"
]
},
"value": {
"type": "string",
"maxLength": 8000
}
},
"required": [
"type",
"value"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"map"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id",
"operation_id",
"fingerprint",
"body"
],
"additionalProperties": false
}gtm_delete_variableDelete variableWrite
gtm_delete_variableDelete variableDelete an unpublished workspace variable. Fingerprint is checked in a fresh separately authorized read first. Google DELETE has no atomic fingerprint comparison, so a concurrent edit can still race. Does not publish the container. Requires explicit user intent.
Changes existing configuration or campaign status. Requires explicit user intent.
Fresh read before the change: gtm_get_variable.
Input parameters
resource_keyRequired- string · Max. characters: 200
workspace_idRequired- string · Max. characters: 40
entity_idRequired- string · Max. characters: 40
operation_idRequired- string · uuid
fingerprintRequired- string · Min. characters: 1 · Max. characters: 200
Full input schema (JSON)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"resource_key": {
"type": "string",
"maxLength": 200,
"pattern": "^accounts\\/[1-9]\\d*\\/containers\\/[1-9]\\d*$"
},
"workspace_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"entity_id": {
"type": "string",
"maxLength": 40,
"pattern": "^[1-9]\\d*$"
},
"operation_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique operation ID. Reuse only to retrieve this exact operation status; never reuse for changed arguments."
},
"fingerprint": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"resource_key",
"workspace_id",
"entity_id",
"operation_id",
"fingerprint"
],
"additionalProperties": false
}A concrete tool call.
JSON-RPC request after MCP initialization. Sample IDs and dates: replace them with your selected resource and reporting period. The AI client handles transport and authorization.
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "gtm_list_tags",
"arguments": {
"resource_key": "accounts/123456/containers/789012",
"workspace_id": "1"
}
}
}How results come back.
structuredContent- Contains the tool result as a JSON object. Google field names are retained. The same JSON is also returned as a text block in content.
- Data by tool
- Workspace and entity reads return the Google configuration including path and fingerprint. Lists may include nextPageToken. Workspace status describes changes/conflicts. Deletion returns status: removed and resource_name.
- Selected resources
- The first list tool returns resources containing resource_key. It lists only resources authorized for this connection.
isError: true- Tool failures return structuredContent.error and request_id, optionally retry_after_seconds. For example: scope_missing for missing access or service_unavailable when a service cannot be reached. Do not repeat an uncertain write blindly.
Access and technical limits.
Changes affect unpublished workspaces. There is no publish, sync or versioning call. Updates and deletes need the current fingerprint. The server reads the resource first; this additional read needs its own authorization and quota. Updates use Google's atomic check; DELETE can still race with a concurrent edit after preflight. body is bounded and requires name and type. Nested parameters are in the full input schema. Review and publish separately in Google Tag Manager.
Connection uses MCP Streamable HTTP with bearer authorization. The server checks read/write scope and the selected resource for each call. Both your Google permissions and MCP connection permissions must allow the operation. Clients discover tools using tools/list; these pages document the tool registry.
Read scope: mcp:gtm:read. Write scope: mcp:gtm:write.
Every write requires a UUID operation_id. Reuse it only for the exact same operation, never with changed arguments. A completed replay reports mutation_status: succeeded and replayed: true, optionally result_ref, rather than the original Google response. Writes are not retried automatically.