mcp-google-forms 1.3.0 → 1.3.2
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 +36 -6
- package/dist/tools/auth.js +3 -0
- package/package.json +2 -2
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", /нет доступа к кабинету|не подключ[её]н к
|
|
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],
|
|
@@ -231,7 +231,28 @@ export function errorDetail(text) {
|
|
|
231
231
|
const FAILURE_ORIGIN = new WeakMap();
|
|
232
232
|
const JS_ERRORS = new Set(["TypeError", "ReferenceError", "RangeError", "SyntaxError", "EvalError", "URIError"]);
|
|
233
233
|
function jsBug(err) {
|
|
234
|
-
|
|
234
|
+
if (!(err instanceof Error) || !JS_ERRORS.has(err.name))
|
|
235
|
+
return undefined;
|
|
236
|
+
// Node's own errors (ERR_INVALID_ARG_TYPE …, system errors) quote the values passed in: their code only.
|
|
237
|
+
const code = err.code;
|
|
238
|
+
if (code !== undefined || "errno" in err || "syscall" in err) {
|
|
239
|
+
return typeof code === "string" && /^[A-Z][A-Z0-9_]{2,40}$/.test(code) ? `${err.name} ${code}` : err.name;
|
|
240
|
+
}
|
|
241
|
+
return `${err.name}: ${err.message.split("\n")[0]}`;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Only the class name of this server's own errors (AuthRequiredError, AbortError), used when the
|
|
245
|
+
* allowlist finds nothing. Never the message: a plain Error or a system error (ENOENT …) can carry
|
|
246
|
+
* user data, so those send nothing.
|
|
247
|
+
*/
|
|
248
|
+
function errorText(err) {
|
|
249
|
+
if (!(err instanceof Error) || "errno" in err || "syscall" in err)
|
|
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}`;
|
|
255
|
+
return /^[A-Z][A-Za-z0-9]*(?:Error|Exception)$/.test(err.name) && err.name !== "Error" ? err.name : undefined;
|
|
235
256
|
}
|
|
236
257
|
/**
|
|
237
258
|
* Node's fetch rejects a network failure as TypeError("fetch failed") with the socket/DNS/TLS error
|
|
@@ -260,8 +281,9 @@ export function noteFailure(result, err) {
|
|
|
260
281
|
FAILURE_ORIGIN.set(result, { origin: "network", ...net });
|
|
261
282
|
else {
|
|
262
283
|
const bug = jsBug(err);
|
|
263
|
-
|
|
264
|
-
|
|
284
|
+
const text = bug ?? errorText(err);
|
|
285
|
+
if (text)
|
|
286
|
+
FAILURE_ORIGIN.set(result, { origin: bug ? "internal" : "error", text });
|
|
265
287
|
}
|
|
266
288
|
}
|
|
267
289
|
}
|
|
@@ -297,8 +319,16 @@ function reportCall(telemetry, tool, value, thrown) {
|
|
|
297
319
|
reason = "error_invalid_request";
|
|
298
320
|
detail = maskedOwnText("local: ", noted.text);
|
|
299
321
|
}
|
|
300
|
-
else
|
|
322
|
+
else {
|
|
301
323
|
detail = errorDetail(resultText(value));
|
|
324
|
+
const own = noted?.origin === "error" ? noted.text : thrown ? errorText(value) : undefined;
|
|
325
|
+
if (!detail && own) {
|
|
326
|
+
detail = own;
|
|
327
|
+
// The class name ("AuthRequiredError") often says more than the message.
|
|
328
|
+
if (reason === "error_other")
|
|
329
|
+
reason = toolOutcome({ isError: true, content: [{ type: "text", text: own }] });
|
|
330
|
+
}
|
|
331
|
+
}
|
|
302
332
|
}
|
|
303
333
|
telemetry.send("tool_call", { tool, reason, error_detail: detail || undefined });
|
|
304
334
|
}
|
package/dist/tools/auth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { registerGoogleAuth, TokenProvider, unconfiguredPrefix, } from "@a1-x-tech/mcp-google-auth";
|
|
2
|
+
import { fail } from "./util.js";
|
|
2
3
|
/**
|
|
3
4
|
* The scopes an in-chat login requests (the per-task table lives in
|
|
4
5
|
* docs/TOOLS.md). The component always adds the identity scopes on top.
|
|
@@ -18,6 +19,8 @@ export const AUTH_OPTIONS = {
|
|
|
18
19
|
serverName: "forms",
|
|
19
20
|
envPrefix: "GOOGLE_FORMS",
|
|
20
21
|
scopes: LOGIN_SCOPES,
|
|
22
|
+
// Login-tool failures go through the server's own renderer, so telemetry gets their origin.
|
|
23
|
+
fail,
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
23
26
|
* Registers the six onboarding tools (auth_status, setup_instructions,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-forms",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "MCP server for the Google Forms API — create forms, manage questions, publish, read responses and watch for new submissions. For Claude, Cursor, Codex and other AI clients.",
|
|
5
5
|
"mcpName": "io.github.A1-x-Tech/mcp-google-forms",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"url": "https://github.com/A1-x-Tech/mcp-google-forms/issues"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@a1-x-tech/mcp-google-auth": "^0.1.
|
|
52
|
+
"@a1-x-tech/mcp-google-auth": "^0.1.2",
|
|
53
53
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
54
54
|
"zod": "^3.25.0"
|
|
55
55
|
},
|