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
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | アカウントID | |
| containerId | Yes | コンテナID | |
| workspaceId | Yes | ワークスペースID | |
| variableId | Yes | 変数ID |
Implementation Reference
- src/index.js:1813-1830 (handler)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 ), }, ], };
- src/index.js:703-728 (schema)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'], }, },
- src/gtm-client.js:290-296 (helper)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; }