@charlie.act7/gemini-notebook-mcp 2.0.0

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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +435 -0
  3. package/dist/auth/account-switcher.d.ts +21 -0
  4. package/dist/auth/account-switcher.d.ts.map +1 -0
  5. package/dist/auth/account-switcher.js +54 -0
  6. package/dist/auth/account-switcher.js.map +1 -0
  7. package/dist/auth/auth-manager.d.ts +139 -0
  8. package/dist/auth/auth-manager.d.ts.map +1 -0
  9. package/dist/auth/auth-manager.js +1006 -0
  10. package/dist/auth/auth-manager.js.map +1 -0
  11. package/dist/browser/chromium-fallback.d.ts +24 -0
  12. package/dist/browser/chromium-fallback.d.ts.map +1 -0
  13. package/dist/browser/chromium-fallback.js +53 -0
  14. package/dist/browser/chromium-fallback.js.map +1 -0
  15. package/dist/browser/watchdog.d.ts +35 -0
  16. package/dist/browser/watchdog.d.ts.map +1 -0
  17. package/dist/browser/watchdog.js +74 -0
  18. package/dist/browser/watchdog.js.map +1 -0
  19. package/dist/config.d.ts +99 -0
  20. package/dist/config.d.ts.map +1 -0
  21. package/dist/config.js +255 -0
  22. package/dist/config.js.map +1 -0
  23. package/dist/errors.d.ts +26 -0
  24. package/dist/errors.d.ts.map +1 -0
  25. package/dist/errors.js +41 -0
  26. package/dist/errors.js.map +1 -0
  27. package/dist/index.d.ts +32 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +558 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/library/metadata.d.ts +14 -0
  32. package/dist/library/metadata.d.ts.map +1 -0
  33. package/dist/library/metadata.js +33 -0
  34. package/dist/library/metadata.js.map +1 -0
  35. package/dist/library/notebook-library.d.ts +70 -0
  36. package/dist/library/notebook-library.d.ts.map +1 -0
  37. package/dist/library/notebook-library.js +311 -0
  38. package/dist/library/notebook-library.js.map +1 -0
  39. package/dist/library/types.d.ts +67 -0
  40. package/dist/library/types.d.ts.map +1 -0
  41. package/dist/library/types.js +8 -0
  42. package/dist/library/types.js.map +1 -0
  43. package/dist/notebooklm/audio.d.ts +67 -0
  44. package/dist/notebooklm/audio.d.ts.map +1 -0
  45. package/dist/notebooklm/audio.js +275 -0
  46. package/dist/notebooklm/audio.js.map +1 -0
  47. package/dist/notebooklm/chat.d.ts +79 -0
  48. package/dist/notebooklm/chat.d.ts.map +1 -0
  49. package/dist/notebooklm/chat.js +631 -0
  50. package/dist/notebooklm/chat.js.map +1 -0
  51. package/dist/notebooklm/citations.d.ts +35 -0
  52. package/dist/notebooklm/citations.d.ts.map +1 -0
  53. package/dist/notebooklm/citations.js +173 -0
  54. package/dist/notebooklm/citations.js.map +1 -0
  55. package/dist/notebooklm/selectors.d.ts +168 -0
  56. package/dist/notebooklm/selectors.d.ts.map +1 -0
  57. package/dist/notebooklm/selectors.js +435 -0
  58. package/dist/notebooklm/selectors.js.map +1 -0
  59. package/dist/notebooklm/sources.d.ts +61 -0
  60. package/dist/notebooklm/sources.d.ts.map +1 -0
  61. package/dist/notebooklm/sources.js +324 -0
  62. package/dist/notebooklm/sources.js.map +1 -0
  63. package/dist/notebooklm/url.d.ts +7 -0
  64. package/dist/notebooklm/url.d.ts.map +1 -0
  65. package/dist/notebooklm/url.js +36 -0
  66. package/dist/notebooklm/url.js.map +1 -0
  67. package/dist/resources/resource-handlers.d.ts +22 -0
  68. package/dist/resources/resource-handlers.d.ts.map +1 -0
  69. package/dist/resources/resource-handlers.js +220 -0
  70. package/dist/resources/resource-handlers.js.map +1 -0
  71. package/dist/session/browser-session.d.ts +147 -0
  72. package/dist/session/browser-session.d.ts.map +1 -0
  73. package/dist/session/browser-session.js +838 -0
  74. package/dist/session/browser-session.js.map +1 -0
  75. package/dist/session/session-manager.d.ts +80 -0
  76. package/dist/session/session-manager.d.ts.map +1 -0
  77. package/dist/session/session-manager.js +294 -0
  78. package/dist/session/session-manager.js.map +1 -0
  79. package/dist/session/shared-context-manager.d.ts +107 -0
  80. package/dist/session/shared-context-manager.d.ts.map +1 -0
  81. package/dist/session/shared-context-manager.js +465 -0
  82. package/dist/session/shared-context-manager.js.map +1 -0
  83. package/dist/tools/definitions/ask-question.d.ts +8 -0
  84. package/dist/tools/definitions/ask-question.d.ts.map +1 -0
  85. package/dist/tools/definitions/ask-question.js +244 -0
  86. package/dist/tools/definitions/ask-question.js.map +1 -0
  87. package/dist/tools/definitions/notebook-management.d.ts +9 -0
  88. package/dist/tools/definitions/notebook-management.d.ts.map +1 -0
  89. package/dist/tools/definitions/notebook-management.js +263 -0
  90. package/dist/tools/definitions/notebook-management.js.map +1 -0
  91. package/dist/tools/definitions/session-management.d.ts +12 -0
  92. package/dist/tools/definitions/session-management.d.ts.map +1 -0
  93. package/dist/tools/definitions/session-management.js +82 -0
  94. package/dist/tools/definitions/session-management.js.map +1 -0
  95. package/dist/tools/definitions/sources.d.ts +14 -0
  96. package/dist/tools/definitions/sources.d.ts.map +1 -0
  97. package/dist/tools/definitions/sources.js +200 -0
  98. package/dist/tools/definitions/sources.js.map +1 -0
  99. package/dist/tools/definitions/system.d.ts +9 -0
  100. package/dist/tools/definitions/system.d.ts.map +1 -0
  101. package/dist/tools/definitions/system.js +152 -0
  102. package/dist/tools/definitions/system.js.map +1 -0
  103. package/dist/tools/definitions.d.ts +12 -0
  104. package/dist/tools/definitions.d.ts.map +1 -0
  105. package/dist/tools/definitions.js +28 -0
  106. package/dist/tools/definitions.js.map +1 -0
  107. package/dist/tools/handlers.d.ts +274 -0
  108. package/dist/tools/handlers.d.ts.map +1 -0
  109. package/dist/tools/handlers.js +840 -0
  110. package/dist/tools/handlers.js.map +1 -0
  111. package/dist/tools/index.d.ts +8 -0
  112. package/dist/tools/index.d.ts.map +1 -0
  113. package/dist/tools/index.js +8 -0
  114. package/dist/tools/index.js.map +1 -0
  115. package/dist/transport/http.d.ts +38 -0
  116. package/dist/transport/http.d.ts.map +1 -0
  117. package/dist/transport/http.js +231 -0
  118. package/dist/transport/http.js.map +1 -0
  119. package/dist/types.d.ts +101 -0
  120. package/dist/types.d.ts.map +1 -0
  121. package/dist/types.js +5 -0
  122. package/dist/types.js.map +1 -0
  123. package/dist/utils/cleanup-manager.d.ts +133 -0
  124. package/dist/utils/cleanup-manager.d.ts.map +1 -0
  125. package/dist/utils/cleanup-manager.js +671 -0
  126. package/dist/utils/cleanup-manager.js.map +1 -0
  127. package/dist/utils/cli-handler.d.ts +16 -0
  128. package/dist/utils/cli-handler.d.ts.map +1 -0
  129. package/dist/utils/cli-handler.js +105 -0
  130. package/dist/utils/cli-handler.js.map +1 -0
  131. package/dist/utils/disclaimer.d.ts +31 -0
  132. package/dist/utils/disclaimer.d.ts.map +1 -0
  133. package/dist/utils/disclaimer.js +43 -0
  134. package/dist/utils/disclaimer.js.map +1 -0
  135. package/dist/utils/logger.d.ts +61 -0
  136. package/dist/utils/logger.d.ts.map +1 -0
  137. package/dist/utils/logger.js +92 -0
  138. package/dist/utils/logger.js.map +1 -0
  139. package/dist/utils/page-utils.d.ts +25 -0
  140. package/dist/utils/page-utils.d.ts.map +1 -0
  141. package/dist/utils/page-utils.js +51 -0
  142. package/dist/utils/page-utils.js.map +1 -0
  143. package/dist/utils/settings-manager.d.ts +37 -0
  144. package/dist/utils/settings-manager.d.ts.map +1 -0
  145. package/dist/utils/settings-manager.js +141 -0
  146. package/dist/utils/settings-manager.js.map +1 -0
  147. package/dist/utils/stealth-utils.d.ts +135 -0
  148. package/dist/utils/stealth-utils.d.ts.map +1 -0
  149. package/dist/utils/stealth-utils.js +399 -0
  150. package/dist/utils/stealth-utils.js.map +1 -0
  151. package/docs/configuration.md +181 -0
  152. package/docs/tools.md +417 -0
  153. package/docs/troubleshooting.md +171 -0
  154. package/docs/usage-guide.md +284 -0
  155. package/package.json +71 -0
@@ -0,0 +1,200 @@
1
+ /**
2
+ * MCP tool definitions for source ingestion + Audio Overview (issues #25, #11).
3
+ *
4
+ * The cross-tool async-audio chain (generate → poll → download) is documented
5
+ * in the server-level `instructions` string (see src/index.ts) so individual
6
+ * descriptions stay focused on one operation each.
7
+ */
8
+ const sharedNotebookTargeting = {
9
+ session_id: {
10
+ type: "string",
11
+ description: "Reuse an existing browser session by id. Recommended when you have " +
12
+ "already called `ask_question` against the same notebook — saves the " +
13
+ "10–15 s page-load time. Obtain from `list_sessions` or any prior " +
14
+ "`ask_question` response (`result.session_id`).",
15
+ },
16
+ notebook_id: {
17
+ type: "string",
18
+ description: "Library notebook id (from `list_notebooks` / `search_notebooks`). " +
19
+ "Defaults to the active notebook (see `select_notebook`) when omitted.",
20
+ },
21
+ notebook_url: {
22
+ type: "string",
23
+ description: "Direct NotebookLM URL — overrides `notebook_id`. Use for ad-hoc " +
24
+ "notebooks not yet in your library. Format: " +
25
+ "`https://notebook.google.com/notebook/<uuid>` (the legacy " +
26
+ "`notebooklm.google.com` host is also accepted).",
27
+ },
28
+ };
29
+ export const addSourceTool = {
30
+ name: "add_source",
31
+ description: "Ingest a source into a NotebookLM notebook. Supports two source types " +
32
+ "in v2.0:\n" +
33
+ " • `url` — NotebookLM crawls and indexes a website\n" +
34
+ " • `text` — paste raw text (treated as a copied document)\n\n" +
35
+ "File / YouTube / Google-Drive uploads are not yet implemented.\n\n" +
36
+ "Returns `sourceCountBefore`/`sourceCountAfter` so the caller can verify " +
37
+ "the new source landed. Call once per source — multiple sources require " +
38
+ "multiple calls. NotebookLM finishes indexing within 5–30 seconds; " +
39
+ "subsequent `ask_question` calls then have the new source in context. " +
40
+ "Free notebooks cap at 50 sources.\n\n" +
41
+ "Known quirk: pasted-text uploads occasionally redirect to a freshly " +
42
+ 'created "Untitled notebook" on Google\'s side. The tool detects this ' +
43
+ "and returns a clear error so you can re-try against the correct URL.",
44
+ inputSchema: {
45
+ type: "object",
46
+ properties: {
47
+ type: {
48
+ type: "string",
49
+ enum: ["url", "text"],
50
+ description: "`url` crawls the supplied website; `text` ingests `content` " +
51
+ "verbatim as a copied document.",
52
+ },
53
+ content: {
54
+ type: "string",
55
+ description: "When `type=url`: a fully-qualified URL (https://…). " +
56
+ "When `type=text`: the raw text body (any length up to NotebookLM's per-source word limit, ~500 k for free tier).",
57
+ },
58
+ title: {
59
+ type: "string",
60
+ description: "Display title shown in the source list. Optional — NotebookLM " +
61
+ "picks a sensible default (page title for URLs, first line for text). " +
62
+ "For text sources, supplying a title is recommended for later " +
63
+ "identification.",
64
+ },
65
+ show_browser: {
66
+ type: "boolean",
67
+ description: "Show the browser window for debugging. Default: false.",
68
+ },
69
+ ...sharedNotebookTargeting,
70
+ },
71
+ required: ["type", "content"],
72
+ },
73
+ annotations: {
74
+ title: "Add source to notebook",
75
+ readOnlyHint: false,
76
+ destructiveHint: false,
77
+ idempotentHint: false,
78
+ openWorldHint: true,
79
+ },
80
+ };
81
+ export const generateAudioTool = {
82
+ name: "generate_audio",
83
+ description: "Trigger podcast-style Audio Overview generation for a notebook.\n\n" +
84
+ "**Async by default** — returns immediately with one of:\n" +
85
+ ' • `status: "started"` — generation just kicked off\n' +
86
+ ' • `status: "in_progress"` — a generation was already running; ' +
87
+ "this call attached to it\n" +
88
+ ' • `status: "ready"` (with `alreadyExisted: true`) — an Audio ' +
89
+ "Overview already existed; nothing was triggered\n\n" +
90
+ "Generation typically takes 2–10 minutes. **Workflow:**\n" +
91
+ " 1. `generate_audio` → returns immediately\n" +
92
+ " 2. Poll `get_audio_status` every ~30 s\n" +
93
+ " 3. When status is `ready`, call `download_audio`\n\n" +
94
+ "Pass `wait_for_completion: true` for legacy synchronous behaviour " +
95
+ "(blocks for up to `timeout_ms`). Audio Overview is the only Studio " +
96
+ "output exposed in v2.0 (Video / Mindmap / Quiz / Infographic / " +
97
+ "Datatable / Presentation are NotebookLM features but not yet wrapped).",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: {
101
+ custom_prompt: {
102
+ type: "string",
103
+ description: 'Optional focus prompt for the Audio Overview, e.g. "Focus on the ' +
104
+ 'API authentication flow and skip pricing". Passed into the ' +
105
+ 'NotebookLM "Customize" sub-dialog before generation starts.',
106
+ },
107
+ wait_for_completion: {
108
+ type: "boolean",
109
+ description: "If true, block until the audio tile is ready (up to `timeout_ms`). " +
110
+ "Default false — return immediately and let the caller poll " +
111
+ "`get_audio_status`.",
112
+ },
113
+ timeout_ms: {
114
+ type: "number",
115
+ description: "Only relevant when `wait_for_completion=true`. Maximum wait for " +
116
+ "the audio tile to appear. Default 600 000 (10 min).",
117
+ },
118
+ show_browser: {
119
+ type: "boolean",
120
+ description: "Show the browser window for debugging. Default: false.",
121
+ },
122
+ ...sharedNotebookTargeting,
123
+ },
124
+ },
125
+ annotations: {
126
+ title: "Generate Audio Overview",
127
+ readOnlyHint: false,
128
+ destructiveHint: false,
129
+ idempotentHint: true, // Idempotent: existing audio is detected and returned as ready
130
+ openWorldHint: true,
131
+ },
132
+ };
133
+ export const getAudioStatusTool = {
134
+ name: "get_audio_status",
135
+ description: "Non-blocking probe for the current Audio Overview state of a notebook.\n\n" +
136
+ "Returned `status` values:\n" +
137
+ " • `ready` — Audio Overview is generated and ready to download\n" +
138
+ " • `in_progress` — generation is currently running\n" +
139
+ " • `not_started` — no Audio Overview exists yet for this notebook\n\n" +
140
+ "Safe to poll every ~30 s while waiting for `generate_audio` to finish. " +
141
+ "When status flips to `ready`, call `download_audio` with a destination " +
142
+ "directory.",
143
+ inputSchema: {
144
+ type: "object",
145
+ properties: {
146
+ show_browser: {
147
+ type: "boolean",
148
+ description: "Show the browser window for debugging. Default: false.",
149
+ },
150
+ ...sharedNotebookTargeting,
151
+ },
152
+ },
153
+ annotations: {
154
+ title: "Get Audio Overview status",
155
+ readOnlyHint: true,
156
+ openWorldHint: true,
157
+ },
158
+ };
159
+ export const downloadAudioTool = {
160
+ name: "download_audio",
161
+ description: "Save the completed Audio Overview to disk as a `.m4a` file. **Pre-" +
162
+ 'condition:** `get_audio_status` must report `status: "ready"`. ' +
163
+ "Calling this before generation completes returns an error message " +
164
+ "explaining what to do.\n\n" +
165
+ "The file lands in `destination_dir` with NotebookLM's suggested " +
166
+ "filename (sanitised — usually the audio's title with underscores). " +
167
+ "The full saved path is returned in `result.filePath`.",
168
+ inputSchema: {
169
+ type: "object",
170
+ properties: {
171
+ destination_dir: {
172
+ type: "string",
173
+ description: "Absolute directory path where the file is saved (created if " +
174
+ "missing). Example: `/Users/jane/Downloads/notebooklm` or " +
175
+ "`/tmp/audio`. Relative paths are NOT recommended — the server " +
176
+ "may run from a different working directory than the caller.",
177
+ },
178
+ show_browser: {
179
+ type: "boolean",
180
+ description: "Show the browser window for debugging. Default: false.",
181
+ },
182
+ ...sharedNotebookTargeting,
183
+ },
184
+ required: ["destination_dir"],
185
+ },
186
+ annotations: {
187
+ title: "Download Audio Overview",
188
+ readOnlyHint: false,
189
+ destructiveHint: false,
190
+ idempotentHint: true,
191
+ openWorldHint: true,
192
+ },
193
+ };
194
+ export const sourceTools = [
195
+ addSourceTool,
196
+ generateAudioTool,
197
+ getAudioStatusTool,
198
+ downloadAudioTool,
199
+ ];
200
+ //# sourceMappingURL=sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.js","sourceRoot":"","sources":["../../../src/tools/definitions/sources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,uBAAuB,GAAG;IAC9B,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,qEAAqE;YACrE,sEAAsE;YACtE,mEAAmE;YACnE,gDAAgD;KACnD;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,oEAAoE;YACpE,uEAAuE;KAC1E;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,kEAAkE;YAClE,6CAA6C;YAC7C,4DAA4D;YAC5D,iDAAiD;KACpD;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,wEAAwE;QACxE,YAAY;QACZ,uDAAuD;QACvD,gEAAgE;QAChE,oEAA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ACd,UAAU,EAAE;YACV,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8DAA8D;oBAC9D,2DAA2D;oBAC3D,gEAAgE;oBAChE,6DAA6D;aAChE;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,wDAAwD;aACtE;YACD,GAAG,uBAAuB;SAC3B;QACD,QAAQ,EAAE,CAAC,iBAAiB,CAAC;KAC9B;IACD,WAAW,EAAE;QACX,KAAK,EAAE,yBAAyB;QAChC,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAW;IACjC,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;CAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ /**
3
+ * System / auth / cleanup tools. The cross-tool first-run workflow lives in
4
+ * the server-level `instructions` string (see src/index.ts) so individual
5
+ * descriptions stay focused on what each tool does, not how the suite
6
+ * fits together.
7
+ */
8
+ export declare const systemTools: Tool[];
9
+ //# sourceMappingURL=system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,IAAI,EAwJ7B,CAAC"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * System / auth / cleanup tools. The cross-tool first-run workflow lives in
3
+ * the server-level `instructions` string (see src/index.ts) so individual
4
+ * descriptions stay focused on what each tool does, not how the suite
5
+ * fits together.
6
+ */
7
+ export const systemTools = [
8
+ {
9
+ name: "get_health",
10
+ description: "Inspect server state. Returns:\n" +
11
+ " • `authenticated` — whether saved Google cookies are still valid\n" +
12
+ " • `notebook_url`, `active_notebook_id`, `active_notebook_name` —\n" +
13
+ " the currently selected library notebook (or null)\n" +
14
+ " • `total_notebooks` — library size\n" +
15
+ " • `active_sessions`, `max_sessions`, `session_timeout` — runtime\n" +
16
+ " session stats (timeout in seconds; sessions auto-close after this)\n" +
17
+ " • `headless`, `auto_login_enabled`, `stealth_enabled` — config\n" +
18
+ "Use this first thing in a new conversation. If `authenticated=false`, " +
19
+ "run `setup_auth` (or `re_auth` to switch accounts).",
20
+ inputSchema: {
21
+ type: "object",
22
+ properties: {},
23
+ },
24
+ annotations: {
25
+ title: "Get server health",
26
+ readOnlyHint: true,
27
+ openWorldHint: false,
28
+ },
29
+ },
30
+ {
31
+ name: "setup_auth",
32
+ description: "Open a browser window for first-time Google login. Returns immediately " +
33
+ "after spawning the browser; the user has up to 10 minutes to complete " +
34
+ "sign-in, then cookies are persisted for future runs. Existing profile " +
35
+ "data is preserved; use `re_auth` when a clean login is required.\n\n" +
36
+ "When to use:\n" +
37
+ " • `get_health` reports `authenticated=false` for the first time\n" +
38
+ " • Auto-login credentials are not configured\n" +
39
+ " • `re_auth` is the right call when you want to *switch* accounts " +
40
+ "or recover from a daily-quota lockout\n\n" +
41
+ "After login finishes, call `get_health` to verify success.\n\n" +
42
+ "If the browser session feels broken (auth keeps failing, stale cookies), " +
43
+ "run `cleanup_data(confirm=true, preserve_library=true)` first, then " +
44
+ "retry `setup_auth`.",
45
+ inputSchema: {
46
+ type: "object",
47
+ properties: {
48
+ show_browser: {
49
+ type: "boolean",
50
+ description: "Show the browser window. Default: true (must be visible so the " +
51
+ "user can interact). For advanced control use `browser_options`.",
52
+ },
53
+ browser_options: {
54
+ type: "object",
55
+ description: "Advanced browser settings. Override visibility, timeout, or " +
56
+ "headless mode (default: visible, 30 s).",
57
+ properties: {
58
+ show: { type: "boolean" },
59
+ headless: { type: "boolean" },
60
+ timeout_ms: { type: "number" },
61
+ },
62
+ },
63
+ },
64
+ },
65
+ annotations: {
66
+ title: "Set up Google authentication",
67
+ readOnlyHint: false,
68
+ destructiveHint: false,
69
+ idempotentHint: true,
70
+ openWorldHint: true,
71
+ },
72
+ },
73
+ {
74
+ name: "re_auth",
75
+ description: "Switch to a different Google account or recover from broken auth. " +
76
+ "Closes all active sessions, deletes saved cookies and Chrome profile, " +
77
+ "and opens a fresh login browser.\n\n" +
78
+ "Common triggers:\n" +
79
+ " • NotebookLM's 50 queries/day free-tier limit is reached and the " +
80
+ "user wants to rotate to another Google account\n" +
81
+ " • `setup_auth` failed and a clean slate is needed\n\n" +
82
+ "After login, call `get_health` to verify. For very stuck states, run " +
83
+ "`cleanup_data(confirm=true, preserve_library=true)` before `re_auth`.",
84
+ inputSchema: {
85
+ type: "object",
86
+ properties: {
87
+ show_browser: {
88
+ type: "boolean",
89
+ description: "Show the browser window. Default: true.",
90
+ },
91
+ browser_options: {
92
+ type: "object",
93
+ properties: {
94
+ show: { type: "boolean" },
95
+ headless: { type: "boolean" },
96
+ timeout_ms: { type: "number" },
97
+ },
98
+ },
99
+ },
100
+ },
101
+ annotations: {
102
+ title: "Re-authenticate",
103
+ readOnlyHint: false,
104
+ destructiveHint: true,
105
+ idempotentHint: false,
106
+ openWorldHint: true,
107
+ },
108
+ },
109
+ {
110
+ name: "cleanup_data",
111
+ description: "Two-phase deep cleanup of all server data on disk (auth state, " +
112
+ "browser profiles, caches, MCP logs, temp backups). Cross-platform " +
113
+ "(Linux/macOS/Windows). Always close all Chrome/Chromium instances " +
114
+ "first — open browsers can lock files.\n\n" +
115
+ "Phase 1 (preview): call with `confirm: false`. Returns a categorised " +
116
+ "list of paths and total size. **No deletion happens.**\n" +
117
+ "Phase 2 (delete): after the user reviews the preview and approves, " +
118
+ "call with `confirm: true`.\n\n" +
119
+ "Set `preserve_library: true` to keep the notebook library file " +
120
+ "(library.json) while wiping everything else — recommended when " +
121
+ "troubleshooting auth.\n\n" +
122
+ "Typical recovery flow:\n" +
123
+ " 1. cleanup_data(confirm=false, preserve_library=true) // preview\n" +
124
+ " 2. cleanup_data(confirm=true, preserve_library=true) // execute\n" +
125
+ " 3. setup_auth (or re_auth)",
126
+ inputSchema: {
127
+ type: "object",
128
+ properties: {
129
+ confirm: {
130
+ type: "boolean",
131
+ description: "false = preview only (default). true = actually delete after " +
132
+ "user reviewed the preview.",
133
+ },
134
+ preserve_library: {
135
+ type: "boolean",
136
+ description: "Keep notebook library.json while deleting everything else. " +
137
+ "Default: false. Set true when only auth/browser state is broken.",
138
+ default: false,
139
+ },
140
+ },
141
+ required: ["confirm"],
142
+ },
143
+ annotations: {
144
+ title: "Cleanup all data",
145
+ readOnlyHint: false,
146
+ destructiveHint: true,
147
+ idempotentHint: true,
148
+ openWorldHint: false,
149
+ },
150
+ },
151
+ ];
152
+ //# sourceMappingURL=system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources":["../../../src/tools/definitions/system.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW;IACjC;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,kCAAkC;YAClC,sEAAsE;YACtE,sEAAsE;YACtE,yDAAyD;YACzD,wCAAwC;YACxC,sEAAsE;YACtE,0EAA0E;YAC1E,oEAAoE;YACpE,wEAAwE;YACxE,qDAAqD;QACvD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,mBAAmB;YAC1B,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF;IACD;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,yEAAyE;YACzE,wEAAwE;YACxE,wEAAwE;YACxE,sEAAsE;YACtE,gBAAgB;YAChB,qEAAqE;YACrE,iDAAiD;YACjD,qEAAqE;YACrE,2CAA2C;YAC3C,gEAAgE;YAChE,2EAA2E;YAC3E,sEAAsE;YACtE,q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E,KAAK;YACrB,aAAa,EAAE,IAAI;SACpB;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,iEAAiE;YACjE,oEAAoE;YACpE,oEAAoE;YACpE,2CAA2C;YAC3C,uEAAuE;YACvE,0DAA0D;YAC1D,qEAAqE;YACrE,gCAAgC;YAChC,iEAAiE;YACjE,iEAAiE;YACjE,2BAA2B;YAC3B,0BAA0B;YAC1B,uEAAuE;YACvE,uEAAuE;YACvE,8BAA8B;QAChC,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,SAAS;oBACf,WAAW,EACT,+DAA+D;wBAC/D,4BAA4B;iBAC/B;gBACD,gBAAgB,EAAE;oBAChB,IAAI,EAAE,SAAS;oBACf,WAAW,EACT,6DAA6D;wBAC7D,kEAAkE;oBACpE,OAAO,EAAE,KAAK;iBACf;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,CAAC;SACtB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF;CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * MCP Tool Definitions
3
+ *
4
+ * Aggregates tool definitions from sub-modules.
5
+ */
6
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
7
+ import type { NotebookLibrary } from "../library/notebook-library.js";
8
+ /**
9
+ * Build Tool Definitions with NotebookLibrary context
10
+ */
11
+ export declare function buildToolDefinitions(library: NotebookLibrary): Tool[];
12
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAOtE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,EAAE,CAcrE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * MCP Tool Definitions
3
+ *
4
+ * Aggregates tool definitions from sub-modules.
5
+ */
6
+ import { askQuestionTool, buildAskQuestionDescription } from "./definitions/ask-question.js";
7
+ import { notebookManagementTools } from "./definitions/notebook-management.js";
8
+ import { sessionManagementTools } from "./definitions/session-management.js";
9
+ import { systemTools } from "./definitions/system.js";
10
+ import { sourceTools } from "./definitions/sources.js";
11
+ /**
12
+ * Build Tool Definitions with NotebookLibrary context
13
+ */
14
+ export function buildToolDefinitions(library) {
15
+ // Update the description for ask_question based on the library state
16
+ const dynamicAskQuestionTool = {
17
+ ...askQuestionTool,
18
+ description: buildAskQuestionDescription(library),
19
+ };
20
+ return [
21
+ dynamicAskQuestionTool,
22
+ ...notebookManagementTools,
23
+ ...sessionManagementTools,
24
+ ...systemTools,
25
+ ...sourceTools,
26
+ ];
27
+ }
28
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,qEAAqE;IACrE,MAAM,sBAAsB,GAAG;QAC7B,GAAG,eAAe;QAClB,WAAW,EAAE,2BAA2B,CAAC,OAAO,CAAC;KAClD,CAAC;IAEF,OAAO;QACL,sBAAsB;QACtB,GAAG,uBAAuB;QAC1B,GAAG,sBAAsB;QACzB,GAAG,WAAW;QACd,GAAG,WAAW;KACf,CAAC;AACJ,CAAC"}