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
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | アカウントID | |
| name | Yes | コンテナ名 | |
| usageContext | Yes | 使用コンテキスト(例: ["web"]) |
Implementation Reference
- src/gtm-client.js:79-86 (handler)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 ), }, ], };
- src/index.js:115-139 (schema)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'], }, },