get_tag
Retrieve detailed configuration and settings for a specific tag in Google Tag Manager to review or modify tracking implementations.
Instructions
指定されたタグの詳細を取得します
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | アカウントID | |
| containerId | Yes | コンテナID | |
| workspaceId | Yes | ワークスペースID | |
| tagId | Yes | タグID |
Implementation Reference
- src/index.js:1029-1046 (handler)Handler logic for the 'get_tag' tool in the MCP server's CallToolRequestHandler. It calls the GTMClient's getTag method with the provided accountId, containerId, workspaceId, and tagId, then returns the JSON-formatted response.case 'get_tag': return { content: [ { type: 'text', text: JSON.stringify( await this.gtmClient.getTag( args.accountId, args.containerId, args.workspaceId, args.tagId ), null, 2 ), }, ], };
- src/index.js:205-226 (schema)Input schema definition for the 'get_tag' tool, specifying required string parameters: accountId, containerId, workspaceId, tagId.inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'アカウントID', }, containerId: { type: 'string', description: 'コンテナID', }, workspaceId: { type: 'string', description: 'ワークスペースID', }, tagId: { type: 'string', description: 'タグID', }, }, required: ['accountId', 'containerId', 'workspaceId', 'tagId'], },
- src/index.js:202-227 (registration)Registration of the 'get_tag' tool in the list of tools returned by ListToolsRequestHandler, including name, description, and input schema.{ name: 'get_tag', description: '指定されたタグの詳細を取得します', inputSchema: { type: 'object', properties: { accountId: { type: 'string', description: 'アカウントID', }, containerId: { type: 'string', description: 'コンテナID', }, workspaceId: { type: 'string', description: 'ワークスペースID', }, tagId: { type: 'string', description: 'タグID', }, }, required: ['accountId', 'containerId', 'workspaceId', 'tagId'], }, },
- src/gtm-client.js:136-142 (helper)Supporting method in GTMClient class that performs the actual Google Tag Manager API call to retrieve tag details using the tagmanager service.async getTag(accountId, containerId, workspaceId, tagId) { await this.ensureAuth(); const response = await this.tagmanager.accounts.containers.workspaces.tags.get({ path: `accounts/${accountId}/containers/${containerId}/workspaces/${workspaceId}/tags/${tagId}` }); return response.data; }