Skip to main content
Glama
ambit1977

Google Tag Manager MCP Server

by ambit1977

get_trigger

Retrieve detailed configuration information for a specific trigger in Google Tag Manager, including its settings and activation conditions.

Instructions

指定されたトリガーの詳細を取得します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesアカウントID
containerIdYesコンテナID
workspaceIdYesワークスペースID
triggerIdYesトリガーID

Implementation Reference

  • The handler function for the 'get_trigger' MCP tool. It extracts parameters from the request, calls gtmClient.getTrigger, stringifies the result as JSON, and returns it as text content.
    case 'get_trigger':
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              await this.gtmClient.getTrigger(
                args.accountId,
                args.containerId,
                args.workspaceId,
                args.triggerId
              ),
              null,
              2
            ),
          },
        ],
      };
  • The schema definition for the 'get_trigger' tool, including name, description, and input schema requiring accountId, containerId, workspaceId, and triggerId.
    {
      name: 'get_trigger',
      description: '指定されたトリガーの詳細を取得します',
      inputSchema: {
        type: 'object',
        properties: {
          accountId: {
            type: 'string',
            description: 'アカウントID',
          },
          containerId: {
            type: 'string',
            description: 'コンテナID',
          },
          workspaceId: {
            type: 'string',
            description: 'ワークスペースID',
          },
          triggerId: {
            type: 'string',
            description: 'トリガーID',
          },
        },
        required: ['accountId', 'containerId', 'workspaceId', 'triggerId'],
      },
  • The core helper method in GTMClient that performs the actual API call to retrieve trigger details using the Google Tag Manager API.
    async getTrigger(accountId, containerId, workspaceId, triggerId) {
      await this.ensureAuth();
      const response = await this.tagmanager.accounts.containers.workspaces.triggers.get({
        path: `accounts/${accountId}/containers/${containerId}/workspaces/${workspaceId}/triggers/${triggerId}`
      });
      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