Skip to main content
Glama
ambit1977

Google Tag Manager MCP Server

by ambit1977

create_container

Create a new Google Tag Manager container to organize and deploy tracking tags, triggers, and variables for websites or mobile apps.

Instructions

新しいコンテナを作成します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesアカウントID
nameYesコンテナ名
usageContextYes使用コンテキスト(例: ["web"])

Implementation Reference

  • The core handler function in GTMClient class that creates a new container by calling the Google Tag Manager API's accounts.containers.create method, after ensuring the user is authenticated.
    async createContainer(accountId, containerData) {
      await this.ensureAuth();
      const response = await this.tagmanager.accounts.containers.create({
        parent: `accounts/${accountId}`,
        requestBody: containerData
      });
      return response.data;
    }
  • src/index.js:962-977 (registration)
    Registers the 'create_container' tool handler in the MCP server's CallToolRequestSchema switch statement, mapping tool arguments to the GTMClient.createContainer method call.
    case 'create_container':
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              await this.gtmClient.createContainer(args.accountId, {
                name: args.name,
                usageContext: args.usageContext,
              }),
              null,
              2
            ),
          },
        ],
      };
  • Defines the tool schema including name, description, and inputSchema for 'create_container' in the ListToolsRequestSchema response.
      name: 'create_container',
      description: '新しいコンテナを作成します',
      inputSchema: {
        type: 'object',
        properties: {
          accountId: {
            type: 'string',
            description: 'アカウントID',
          },
          name: {
            type: 'string',
            description: 'コンテナ名',
          },
          usageContext: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['web', 'android', 'ios', 'amp'],
            },
            description: '使用コンテキスト(例: ["web"])',
          },
        },
        required: ['accountId', 'name', 'usageContext'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. '作成します' (creates) implies a write operation, but the description doesn't disclose any behavioral traits such as permissions required, whether creation is idempotent, rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap.

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 and front-loaded with no unnecessary words or structural issues.

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 this is a mutation tool (creating a container) with no annotations and no output schema, the description is incomplete. It doesn't explain what a container is in this context, what the creation entails, or what to expect as a result. The agent lacks crucial context for proper tool invocation despite the good schema coverage.

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?

The description adds no parameter information beyond what the input schema provides. Schema description coverage is 100%, with all three parameters (accountId, name, usageContext) documented in the schema. The baseline score of 3 is appropriate as the schema does the heavy lifting, but the description doesn't add any contextual meaning about parameters.

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 '新しいコンテナを作成します' (creates a new container) clearly states the action (creates) and resource (container). It distinguishes from siblings like 'get_container' or 'list_containers' by specifying creation rather than retrieval. However, it doesn't specify what type of container or differentiate from other creation tools like 'create_tag' or 'create_variable' beyond the resource name.

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 (e.g., authentication), when not to use it, or how it relates to sibling tools like 'get_container' or 'list_containers'. The agent must infer usage from the name 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