Skip to main content
Glama
ambit1977

Google Tag Manager MCP Server

by ambit1977

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
NameRequiredDescriptionDefault
accountIdYesアカウントID
containerIdYesコンテナID
workspaceIdYesワークスペースID
tagIdYesタグID

Implementation Reference

  • 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
            ),
          },
        ],
      };
  • 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'],
      },
    },
  • 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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states what the tool does (get details) but doesn't disclose behavioral traits: whether this is a read-only operation, what format/details are returned, error conditions, authentication requirements, rate limits, or whether it's idempotent. For a tool with 4 required parameters and no annotations, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Japanese that directly states the tool's purpose. It's appropriately sized for a simple retrieval tool and front-loads the essential information. There's zero wasted verbiage or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 required parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'tag details' include, how tags relate to containers/workspaces, authentication requirements, or error handling. For a tool in what appears to be a tag management system with multiple sibling tools, more context about the tag resource and its relationships would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all 4 parameters clearly documented in Japanese (accountId, containerId, workspaceId, tagId). The description adds no parameter semantics beyond what the schema provides - it doesn't explain relationships between parameters (e.g., tagId is scoped within container/workspace) or provide examples. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as 'get details of a specified tag' (指定されたタグの詳細を取得します), which is a specific verb+resource combination. It distinguishes from sibling tools like list_tags (which lists multiple tags) and update_tag/delete_tag (which modify tags). However, it doesn't explicitly mention what 'details' include or differentiate from get_container/get_trigger/get_variable which fetch other resource types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like authentication), when to use get_tag versus list_tags (for single vs multiple tags), or any context about tag hierarchy (tags belong to containers/workspaces). The agent must infer usage from the tool name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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