Skip to main content
Glama
ambit1977

Google Tag Manager MCP Server

by ambit1977

get_variable

Retrieve detailed information about a specific Google Tag Manager variable, including its configuration and settings, by providing account, container, workspace, and variable IDs.

Instructions

指定された変数の詳細を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesアカウントID
containerIdYesコンテナID
workspaceIdYesワークスペースID
variableIdYes変数ID

Implementation Reference

  • MCP tool handler for 'get_variable': extracts arguments and calls GTMClient.getVariable to retrieve the variable details from GTM API.
    case 'get_variable': return { content: [ { type: 'text', text: JSON.stringify( await this.gtmClient.getVariable( args.accountId, args.containerId, args.workspaceId, args.variableId ), null, 2 ), }, ], };
  • Input schema definition for the 'get_variable' tool, specifying required parameters: accountId, containerId, workspaceId, variableId.
    { name: 'get_variable', description: '指定された変数の詳細を取得します', inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'アカウントID', }, containerId: { type: 'string', description: 'コンテナID', }, workspaceId: { type: 'string', description: 'ワークスペースID', }, variableId: { type: 'string', description: '変数ID', }, }, required: ['accountId', 'containerId', 'workspaceId', 'variableId'], }, },
  • GTMClient method that authenticates and calls Google Tag Manager API to fetch the specified variable.
    async getVariable(accountId, containerId, workspaceId, variableId) { await this.ensureAuth(); const response = await this.tagmanager.accounts.containers.workspaces.variables.get({ path: `accounts/${accountId}/containers/${containerId}/workspaces/${workspaceId}/variables/${variableId}` }); return response.data; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ambit1977/GTM-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server