mcp-google-tagmanager 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/telemetry.js CHANGED
@@ -135,10 +135,10 @@ const OUTCOME_PATTERNS = [
135
135
  ["error_timeout", /timed?[ _-]?out|таймаут|ETIMEDOUT|AbortError|не был готов|not ready/i],
136
136
  ["error_network", /ECONNRESET|ECONNREFUSED|ENOTFOUND|EAI_AGAIN|EPIPE|fetch failed|socket hang up/i],
137
137
  ["error_rate_limit", /\b429\b|rate[ _-]?limit|too many requests|quota|квот|лимит|\[(?:56|152|506|9000)\]/i],
138
- ["error_permission", /нет доступа к кабинету|не подключ[её]н к аккаунту/i],
138
+ ["error_permission", /нет доступа к кабинету|не подключ[её]н к аккаунту|accessNotConfigured|SERVICE_DISABLED/i],
139
139
  [
140
140
  "error_auth",
141
- /\b401\b|unauthori[sz]ed|unauthenticated|invalid[ _-]?(?:token|grant|credentials)|token (?:expired|revoked)|login required|AuthRequired|авториз|не подключ|\[53\]/i,
141
+ /\b401\b|unauthori[sz]ed|unauthenticated|invalid[ _-]?(?:token|grant|credentials)|token (?:expired|revoked)|login required|AuthRequired|OAuthError|авториз|не подключ|\[53\]/i,
142
142
  ],
143
143
  ["error_permission", /\b403\b|forbidden|access[ _-]?denied|permission|insufficient[ _-]?scope|нет доступа|\[(?:54|3228)\]/i],
144
144
  ["error_not_found", /\b404\b|not[ _-]?found|не найден|не существует|\[8800\]/i],
@@ -248,6 +248,10 @@ function jsBug(err) {
248
248
  function errorText(err) {
249
249
  if (!(err instanceof Error) || "errno" in err || "syscall" in err)
250
250
  return undefined;
251
+ // OAuthError's code is a fixed OAuth/Google vocabulary (invalid_grant, accessNotConfigured), not user data.
252
+ const code = err.code;
253
+ if (err.name === "OAuthError" && typeof code === "string" && /^[A-Za-z_]{2,40}$/.test(code))
254
+ return `OAuthError ${code}`;
251
255
  return /^[A-Z][A-Za-z0-9]*(?:Error|Exception)$/.test(err.name) && err.name !== "Error" ? err.name : undefined;
252
256
  }
253
257
  /**
@@ -1,12 +1,17 @@
1
1
  import { OAuthError, registerGoogleAuth, TokenProvider, unconfiguredPrefix, USERINFO_URL, } from "@a1-x-tech/mcp-google-auth";
2
2
  import { probeApi } from "../client.js";
3
3
  import { TagManagerError } from "../types.js";
4
+ import { fail } from "./util.js";
4
5
  /**
5
6
  * The scopes an in-chat login requests (the per-task table lives in
6
- * docs/TOOLS.md). The component always adds the identity scopes on top. Tag Manager splits editing and publishing: the edit scope covers workspaces, tags and versions, the publish scope is what actually pushes a version live.
7
+ * docs/TOOLS.md). The component always adds the identity scopes on top. Tag Manager grants
8
+ * three things separately: edit.containers covers workspaces, tags, triggers and variables,
9
+ * edit.containerversions is what create_version needs (edit.containers alone gets 403 there),
10
+ * and publish is what actually pushes a version live.
7
11
  */
8
12
  export const LOGIN_SCOPES = [
9
13
  "https://www.googleapis.com/auth/tagmanager.edit.containers",
14
+ "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
10
15
  "https://www.googleapis.com/auth/tagmanager.publish",
11
16
  ];
12
17
  /**
@@ -93,6 +98,8 @@ export const AUTH_OPTIONS = {
93
98
  envPrefix: "GOOGLE_TAGMANAGER",
94
99
  scopes: LOGIN_SCOPES,
95
100
  verifyIdentity,
101
+ // Login-tool failures go through the server's own renderer, so telemetry gets their origin.
102
+ fail,
96
103
  };
97
104
  /**
98
105
  * Registers the six onboarding tools (auth_status, setup_instructions,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-google-tagmanager",
3
- "version": "1.3.1",
4
- "description": "MCP server for the Google Tag Manager API v2 \u2014 accounts, containers, workspaces, tags, triggers, variables, versions and publishing. For Claude, Cursor, Codex and other AI clients.",
3
+ "version": "1.3.3",
4
+ "description": "MCP server for the Google Tag Manager API v2 — accounts, containers, workspaces, tags, triggers, variables, versions and publishing. For Claude, Cursor, Codex and other AI clients.",
5
5
  "mcpName": "io.github.A1-x-Tech/mcp-google-tagmanager",
6
6
  "type": "module",
7
7
  "bin": {
@@ -51,7 +51,7 @@
51
51
  "url": "https://github.com/A1-x-Tech/mcp-google-tagmanager/issues"
52
52
  },
53
53
  "dependencies": {
54
- "@a1-x-tech/mcp-google-auth": "^0.1.0",
54
+ "@a1-x-tech/mcp-google-auth": "^0.1.2",
55
55
  "@modelcontextprotocol/sdk": "^1.29.0",
56
56
  "zod": "^3.25.0"
57
57
  },