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;
    }
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 mentions retrieving details but doesn't disclose behavioral aspects like whether it's read-only, requires authentication, has rate limits, or what format/details are returned. For a tool with no annotations, this is insufficient.

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 function without unnecessary words. It's appropriately sized and front-loaded with the core purpose.

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 no annotations, no output schema, and 4 required parameters, the description is incomplete. It doesn't explain what 'details' are returned, error conditions, or dependencies on other tools (e.g., needing IDs from 'list_variables'). For a retrieval tool in this context, more information is needed.

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%, so the schema already documents all 4 parameters. The description doesn't add any meaning beyond the schema, such as explaining relationships between parameters or usage context. 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 action ('取得します' - retrieve/get) and the resource ('変数の詳細' - variable details), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'list_variables' or 'get_container', which would require a 5.

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?

No guidance is provided on when to use this tool versus alternatives like 'list_variables' or other 'get_' tools. The description only states what it does, not when it's appropriate or what prerequisites exist.

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