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'], }, },

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