templates_import_from_gallery
Import a community template from the Gallery into a GTM workspace by GitHub owner/repo, so it can be used for tag creation.
Instructions
[WRITE] Install a Community Template Gallery template into a workspace by GitHub owner and repository, so a pixel can use its official sandboxed template instead of Custom HTML. Requires GTM_MCP_ENABLE_WRITES=true and confirm=true. The GTM API DOES support this (templates.import_from_gallery); never tell the user it is UI-only. Idempotent: importing one already present returns it unchanged rather than creating a duplicate. Returns the installed template. To build a tag on it you need its tag TYPE (a cvt_... string): READ that from the container rather than constructing it from the templateId, because the format is not what it appears to be. Pass the exact string as type to tags_create along with that template's own field keys (template-specific, e.g. Meta Pixel uses pixelId). Common pairs: facebook/GoogleTagManager-WebTemplate-For-FacebookPixel (Meta Pixel), tiktok/gtm-template-pixel (TikTok), linkedin/linkedin-gtm-community-template (LinkedIn Insight Tag 2.0), Snapchat/snapchat-google-tag-manager (Snap Pixel), pinterest/ws-gtm-template (Pinterest, web) or pinterest/ss-gtm-template (Pinterest, server), stape-io/facebook-tag and stape-io/tiktok-tag (Stape server-side).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | Optional gallery version SHA. Defaults to the latest published version. | |
| owner | Yes | GitHub owner of the gallery template, e.g. "linkedin". | |
| confirm | Yes | Must be true to confirm this write operation. | |
| accountId | Yes | The GTM account ID. | |
| repository | Yes | GitHub repository, e.g. "linkedin-gtm-community-template". | |
| containerId | Yes | The GTM container ID. | |
| workspaceId | Yes | The GTM workspace ID. |