@charlie.act7/gemini-notebook-mcp 2.1.2 → 2.3.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 (122) hide show
  1. package/README.md +461 -434
  2. package/dist/auth/auth-manager.d.ts +2 -6
  3. package/dist/auth/auth-manager.d.ts.map +1 -1
  4. package/dist/auth/auth-manager.js +50 -58
  5. package/dist/auth/auth-manager.js.map +1 -1
  6. package/dist/config.d.ts +3 -0
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +8 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/errors.d.ts +18 -5
  11. package/dist/errors.d.ts.map +1 -1
  12. package/dist/errors.js +69 -6
  13. package/dist/errors.js.map +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +101 -48
  16. package/dist/index.js.map +1 -1
  17. package/dist/library/notebook-library.d.ts +7 -3
  18. package/dist/library/notebook-library.d.ts.map +1 -1
  19. package/dist/library/notebook-library.js +190 -35
  20. package/dist/library/notebook-library.js.map +1 -1
  21. package/dist/library/types.d.ts +18 -0
  22. package/dist/library/types.d.ts.map +1 -1
  23. package/dist/notebooklm/artifact-store.d.ts +26 -0
  24. package/dist/notebooklm/artifact-store.d.ts.map +1 -0
  25. package/dist/notebooklm/artifact-store.js +102 -0
  26. package/dist/notebooklm/artifact-store.js.map +1 -0
  27. package/dist/notebooklm/audio.d.ts +3 -0
  28. package/dist/notebooklm/audio.d.ts.map +1 -1
  29. package/dist/notebooklm/audio.js +72 -39
  30. package/dist/notebooklm/audio.js.map +1 -1
  31. package/dist/notebooklm/chat.d.ts.map +1 -1
  32. package/dist/notebooklm/chat.js +22 -14
  33. package/dist/notebooklm/chat.js.map +1 -1
  34. package/dist/notebooklm/citations.d.ts +17 -22
  35. package/dist/notebooklm/citations.d.ts.map +1 -1
  36. package/dist/notebooklm/citations.js +148 -115
  37. package/dist/notebooklm/citations.js.map +1 -1
  38. package/dist/notebooklm/selectors.d.ts +54 -2
  39. package/dist/notebooklm/selectors.d.ts.map +1 -1
  40. package/dist/notebooklm/selectors.js +109 -2
  41. package/dist/notebooklm/selectors.js.map +1 -1
  42. package/dist/notebooklm/sources.d.ts +18 -3
  43. package/dist/notebooklm/sources.d.ts.map +1 -1
  44. package/dist/notebooklm/sources.js +128 -32
  45. package/dist/notebooklm/sources.js.map +1 -1
  46. package/dist/resources/resource-handlers.js +2 -2
  47. package/dist/resources/resource-handlers.js.map +1 -1
  48. package/dist/session/browser-session.d.ts +17 -10
  49. package/dist/session/browser-session.d.ts.map +1 -1
  50. package/dist/session/browser-session.js +165 -169
  51. package/dist/session/browser-session.js.map +1 -1
  52. package/dist/session/session-manager.d.ts +12 -7
  53. package/dist/session/session-manager.d.ts.map +1 -1
  54. package/dist/session/session-manager.js +120 -80
  55. package/dist/session/session-manager.js.map +1 -1
  56. package/dist/session/shared-context-manager.d.ts.map +1 -1
  57. package/dist/session/shared-context-manager.js +12 -10
  58. package/dist/session/shared-context-manager.js.map +1 -1
  59. package/dist/tools/definitions/ask-question.d.ts +4 -3
  60. package/dist/tools/definitions/ask-question.d.ts.map +1 -1
  61. package/dist/tools/definitions/ask-question.js +9 -109
  62. package/dist/tools/definitions/ask-question.js.map +1 -1
  63. package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
  64. package/dist/tools/definitions/notebook-management.js +47 -4
  65. package/dist/tools/definitions/notebook-management.js.map +1 -1
  66. package/dist/tools/definitions/session-management.d.ts.map +1 -1
  67. package/dist/tools/definitions/session-management.js +2 -0
  68. package/dist/tools/definitions/session-management.js.map +1 -1
  69. package/dist/tools/definitions/sources.d.ts +8 -0
  70. package/dist/tools/definitions/sources.d.ts.map +1 -1
  71. package/dist/tools/definitions/sources.js +152 -15
  72. package/dist/tools/definitions/sources.js.map +1 -1
  73. package/dist/tools/definitions/system.d.ts.map +1 -1
  74. package/dist/tools/definitions/system.js +23 -19
  75. package/dist/tools/definitions/system.js.map +1 -1
  76. package/dist/tools/definitions.d.ts +3 -3
  77. package/dist/tools/definitions.d.ts.map +1 -1
  78. package/dist/tools/definitions.js +5 -9
  79. package/dist/tools/definitions.js.map +1 -1
  80. package/dist/tools/handlers.d.ts +101 -14
  81. package/dist/tools/handlers.d.ts.map +1 -1
  82. package/dist/tools/handlers.js +280 -76
  83. package/dist/tools/handlers.js.map +1 -1
  84. package/dist/tools/validation.d.ts +6 -0
  85. package/dist/tools/validation.d.ts.map +1 -0
  86. package/dist/tools/validation.js +267 -0
  87. package/dist/tools/validation.js.map +1 -0
  88. package/dist/transport/http.d.ts +2 -0
  89. package/dist/transport/http.d.ts.map +1 -1
  90. package/dist/transport/http.js +6 -1
  91. package/dist/transport/http.js.map +1 -1
  92. package/dist/types.d.ts +15 -1
  93. package/dist/types.d.ts.map +1 -1
  94. package/dist/utils/cleanup-manager.d.ts +35 -115
  95. package/dist/utils/cleanup-manager.d.ts.map +1 -1
  96. package/dist/utils/cleanup-manager.js +179 -632
  97. package/dist/utils/cleanup-manager.js.map +1 -1
  98. package/dist/utils/disclaimer.d.ts +2 -1
  99. package/dist/utils/disclaimer.d.ts.map +1 -1
  100. package/dist/utils/disclaimer.js +3 -2
  101. package/dist/utils/disclaimer.js.map +1 -1
  102. package/dist/utils/logger.d.ts +26 -39
  103. package/dist/utils/logger.d.ts.map +1 -1
  104. package/dist/utils/logger.js +104 -50
  105. package/dist/utils/logger.js.map +1 -1
  106. package/dist/utils/operation.d.ts +8 -0
  107. package/dist/utils/operation.d.ts.map +1 -0
  108. package/dist/utils/operation.js +42 -0
  109. package/dist/utils/operation.js.map +1 -0
  110. package/dist/utils/page-utils.d.ts.map +1 -1
  111. package/dist/utils/page-utils.js +3 -3
  112. package/dist/utils/page-utils.js.map +1 -1
  113. package/dist/version.d.ts +3 -0
  114. package/dist/version.d.ts.map +1 -0
  115. package/dist/version.js +17 -0
  116. package/dist/version.js.map +1 -0
  117. package/docs/configuration.md +205 -179
  118. package/docs/implementation-plan.md +135 -0
  119. package/docs/tools.md +473 -412
  120. package/docs/troubleshooting.md +161 -159
  121. package/docs/usage-guide.md +282 -282
  122. package/package.json +4 -3
package/docs/tools.md CHANGED
@@ -1,423 +1,484 @@
1
- # Tools
2
-
3
- Every tool registered in v2.0.0, with parameter schema, an example invocation (MCP `tools/call` arguments shape), and the expected return shape. New v2 tools are flagged.
4
-
5
- The server returns each tool result wrapped as `{ "success": true, "data": <object> }` (or `{ "success": false, "error": <string> }`). The shapes below describe the inner `data`.
6
-
7
- ---
8
-
9
- ## ask_question
10
-
11
- Ask a question against a notebook. Reuses an existing browser session when `session_id` is supplied. Citation extraction reads the DOM citation panel after the answer settles.
12
-
13
- **v2 additions**: `source_format`, `_provenance` envelope on the result, AI-generated answer prefix.
14
-
15
- ### Parameters
16
-
17
- | Name | Type | Required | Notes |
18
- |---|---|---|---|
19
- | `question` | string | yes | The question to ask. |
20
- | `session_id` | string | no | Reuse an existing session for context. Omit to create a new one. |
21
- | `notebook_id` | string | no | Library notebook ID. Falls back to active notebook. |
22
- | `notebook_url` | string | no | Ad-hoc NotebookLM URL. Overrides `notebook_id`. |
23
- | `source_format` | `none` \| `inline` \| `footnotes` \| `json` | no | Citation rendering. Default `none`. |
24
- | `show_browser` | bool | no | Shorthand for `browser_options.show`. |
25
- | `browser_options` | object | no | Per-call browser overrides — see [`docs/configuration.md`](./configuration.md#per-call-browser-options). |
26
-
27
- ### Example
28
-
29
- ```json
30
- {
31
- "name": "ask_question",
32
- "arguments": {
33
- "question": "How does the OAuth refresh token rotation work?",
34
- "notebook_id": "auth-notebook",
35
- "source_format": "footnotes"
36
- }
37
- }
38
- ```
39
-
40
- ### Return shape
41
-
42
- ```jsonc
43
- {
44
- "status": "success",
45
- "question": "How does the OAuth refresh token rotation work?",
46
- "answer": "[AI-GENERATED ...] The refresh token is rotated each ...\n\nSources:\n[1] auth-spec.pdf — ...",
47
- "session_id": "ses_…",
48
- "notebook_url": "https://notebook.google.com/notebook/…",
49
- "session_info": {
50
- "age_seconds": 12,
51
- "message_count": 3,
52
- "last_activity": "2026-04-30T12:00:00.000Z"
53
- },
54
- "_provenance": {
55
- "provider": "google-notebooklm",
56
- "model": "gemini-2.5",
57
- "via": "chrome-automation",
58
- "grounding": "user-uploaded-documents",
59
- "ai_generated": true
60
- },
61
- "source_format": "footnotes",
62
- "sources": [
63
- { "index": 1, "title": "auth-spec.pdf", "excerpt": "Refresh tokens MUST be rotated…" }
64
- ]
65
- }
66
- ```
67
-
68
- `sources` is omitted when `source_format=none` or when no citations were found.
69
-
70
- ---
71
-
72
- ## add_source — new in v2
73
-
74
- Add a source to a notebook. v2 supports `type=url` (web crawl) and `type=text` (paste). File / YouTube / Drive uploads are not supported.
75
-
76
- ### Parameters
77
-
78
- | Name | Type | Required | Notes |
79
- |---|---|---|---|
80
- | `type` | `url` \| `text` | yes | |
81
- | `content` | string | yes | URL when `type=url`, raw text when `type=text`. |
82
- | `title` | string | no | Optional display title. NotebookLM picks a default. |
83
- | `session_id` | string | no | Reuse an existing browser session. |
84
- | `notebook_id` | string | no | Library notebook ID. |
85
- | `notebook_url` | string | no | Ad-hoc URL. Overrides `notebook_id`. |
86
-
87
- ### Example
88
-
89
- ```json
90
- {
91
- "name": "add_source",
92
- "arguments": {
93
- "type": "url",
94
- "content": "https://docs.n8n.io/code/builtin/json-jmespath/",
95
- "title": "n8n JMESPath builtin"
96
- }
97
- }
98
- ```
99
-
100
- ### Return shape
101
-
102
- ```jsonc
103
- {
104
- "status": "success",
105
- "type": "url",
106
- "title": "n8n JMESPath builtin",
107
- "source_count_before": 12,
108
- "source_count_after": 13,
109
- "added": true
110
- }
111
- ```
112
-
113
- ---
114
-
115
- ## generate_audio — new in v2
116
-
117
- Generate a podcast-style Audio Overview for a notebook. Resolves when the audio element is ready.
118
-
119
- ### Parameters
120
-
121
- | Name | Type | Required | Notes |
122
- |---|---|---|---|
123
- | `custom_prompt` | string | no | Optional focus prompt. |
124
- | `timeout_ms` | number | no | Wait ceiling. Default `600000`. |
125
- | `session_id` | string | no | |
126
- | `notebook_id` | string | no | |
127
- | `notebook_url` | string | no | |
128
-
129
- ### Example
130
-
131
- ```json
132
- {
133
- "name": "generate_audio",
134
- "arguments": {
135
- "custom_prompt": "Focus on the migration strategy",
136
- "timeout_ms": 900000
137
- }
138
- }
139
- ```
140
-
141
- ### Return shape
142
-
143
- ```jsonc
144
- {
145
- "status": "success",
146
- "ready": true,
147
- "duration_ms": 412000
148
- }
149
- ```
150
-
151
- Pair with `download_audio` to persist the file. Video / Infographic / Slides are not in v2.0.0.
152
-
153
- ---
154
-
155
- ## download_audio — new in v2
156
-
157
- Download the most recent Audio Overview to disk.
158
-
159
- ### Parameters
160
-
161
- | Name | Type | Required | Notes |
162
- |---|---|---|---|
163
- | `destination_dir` | string | yes | Absolute directory. Created if missing. |
164
- | `session_id` | string | no | |
165
- | `notebook_id` | string | no | |
166
- | `notebook_url` | string | no | |
167
-
168
- ### Example
169
-
170
- ```json
171
- {
172
- "name": "download_audio",
173
- "arguments": {
174
- "destination_dir": "/Users/me/Downloads/notebooklm"
175
- }
176
- }
177
- ```
178
-
179
- ### Return shape
180
-
181
- ```jsonc
182
- {
183
- "status": "success",
184
- "file_path": "/Users/me/Downloads/notebooklm/overview-2026-04-30.wav",
185
- "size_bytes": 9_412_000
186
- }
187
- ```
188
-
189
- Run `generate_audio` first if no Audio Overview exists yet.
190
-
191
- ---
192
-
193
- ## add_notebook
194
-
195
- Add a NotebookLM share-URL to the local library. The tool description enforces a confirmation workflow on the host agent — do not call without explicit user consent.
196
-
197
- ### Parameters
198
-
199
- | Name | Type | Required | Notes |
200
- |---|---|---|---|
201
- | `url` | string | yes | NotebookLM share URL. |
202
- | `name` | string | yes | Display name. |
203
- | `description` | string | yes | Short description of the notebook content. |
204
- | `topics` | string[] | yes | Topics covered. |
205
- | `content_types` | string[] | no | e.g. `["documentation", "examples"]`. |
206
- | `use_cases` | string[] | no | When to consult this notebook. |
207
- | `tags` | string[] | no | Optional organizational tags. |
208
-
209
- ### Return shape
210
-
211
- ```jsonc
212
- {
213
- "status": "added",
214
- "id": "nb_abcd",
215
- "name": "n8n Documentation",
216
- "active": true
217
- }
218
- ```
219
-
220
- ---
221
-
222
- ## list_notebooks
223
-
224
- No parameters. Returns the full library.
225
-
226
- ### Return shape
227
-
228
- ```jsonc
229
- {
230
- "active_notebook_id": "nb_abcd",
231
- "notebooks": [
232
- {
233
- "id": "nb_abcd",
234
- "name": "n8n Documentation",
235
- "url": "https://notebook.google.com/notebook/…",
236
- "description": "n8n core + builtin nodes",
237
- "topics": ["workflow automation", "n8n"],
238
- "use_cases": ["building n8n workflows"],
239
- "tags": ["docs"],
240
- "use_count": 42
241
- }
242
- ]
243
- }
244
- ```
245
-
246
- ---
247
-
248
- ## get_notebook
249
-
250
- | Name | Type | Required |
251
- |---|---|---|
252
- | `id` | string | yes |
253
-
254
- Returns one entry from `list_notebooks`.
255
-
256
- ---
257
-
258
- ## select_notebook
259
-
260
- Set a notebook as the active default.
261
-
262
- | Name | Type | Required |
263
- |---|---|---|
264
- | `id` | string | yes |
265
-
266
- ### Return shape
267
-
268
- ```jsonc
269
- { "status": "active", "id": "nb_abcd", "name": "n8n Documentation" }
270
- ```
271
-
272
- ---
273
-
274
- ## update_notebook
275
-
276
- | Name | Type | Required |
277
- |---|---|---|
278
- | `id` | string | yes |
279
- | `name` | string | no |
280
- | `description` | string | no |
281
- | `topics` | string[] | no |
282
- | `content_types` | string[] | no |
283
- | `use_cases` | string[] | no |
284
- | `tags` | string[] | no |
285
- | `url` | string | no |
286
-
287
- Returns the updated entry.
288
-
289
- ---
290
-
291
- ## remove_notebook
292
-
293
- Removes the entry from the local library only — does not delete the notebook in NotebookLM.
294
-
295
- | Name | Type | Required |
296
- |---|---|---|
297
- | `id` | string | yes |
298
-
299
- ---
300
-
301
- ## search_notebooks
302
-
303
- Searches name, description, topics, tags.
304
-
305
- | Name | Type | Required |
306
- |---|---|---|
307
- | `query` | string | yes |
308
-
309
- Returns an array of matching entries.
310
-
311
- ---
312
-
313
- ## get_library_stats
314
-
315
- No parameters. Returns total notebooks, total queries, top-used notebooks.
316
-
317
- ---
318
-
319
- ## list_sessions
320
-
321
- No parameters. Returns active sessions with age, message count, last-activity timestamp.
322
-
323
- ---
324
-
325
- ## close_session
326
-
327
- | Name | Type | Required |
328
- |---|---|---|
329
- | `session_id` | string | yes |
330
-
331
- ---
332
-
333
- ## reset_session
334
-
335
- Clears chat history while keeping the same `session_id`.
336
-
337
- | Name | Type | Required |
338
- |---|---|---|
339
- | `session_id` | string | yes |
340
-
341
- ---
342
-
343
- ## get_health
344
-
345
- No parameters.
346
-
347
- ### Return shape
348
-
349
- ```jsonc
1
+ # Tools
2
+
3
+ Browser-backed calls honor MCP request cancellation. Cancellation returns a
4
+ structured `CANCELLED` error; an unverified required selector returns
5
+ `UI_CHANGED` instead of an ambiguous empty result.
6
+
7
+ Every tool registered in the current 2.x release, with parameter schema, an example invocation (MCP `tools/call` arguments shape), and the expected return shape.
8
+
9
+ The server returns each tool result wrapped as `{ "success": true, "data": <object> }` (or `{ "success": false, "error": <string> }`). The shapes below describe the inner `data`.
10
+
11
+ ---
12
+
13
+ ## ask_question
14
+
15
+ Ask a question against a notebook. Reuses an existing browser session when `session_id` is supplied. Citation extraction reads the DOM citation panel after the answer settles.
16
+
17
+ **v2 additions**: `source_format`, `_provenance` envelope on the result, AI-generated answer prefix.
18
+
19
+ ### Parameters
20
+
21
+ | Name | Type | Required | Notes |
22
+ |---|---|---|---|
23
+ | `question` | string | yes | The question to ask. |
24
+ | `session_id` | string | no | Reuse an existing session for context. Omit to create a new one. |
25
+ | `notebook_id` | string | no | Library notebook ID. Falls back to active notebook. |
26
+ | `notebook_url` | string | no | Ad-hoc NotebookLM URL. Overrides `notebook_id`. |
27
+ | `source_format` | `none` \| `inline` \| `footnotes` \| `json` | no | Citation rendering. Default `none`. |
28
+ | `show_browser` | bool | no | Shorthand for `browser_options.show`. |
29
+ | `browser_options` | object | no | Per-call browser overrides — see [`docs/configuration.md`](./configuration.md#per-call-browser-options). |
30
+
31
+ ### Example
32
+
33
+ ```json
34
+ {
35
+ "name": "ask_question",
36
+ "arguments": {
37
+ "question": "How does the OAuth refresh token rotation work?",
38
+ "notebook_id": "auth-notebook",
39
+ "source_format": "footnotes"
40
+ }
41
+ }
42
+ ```
43
+
44
+ ### Return shape
45
+
46
+ ```jsonc
47
+ {
48
+ "status": "success",
49
+ "question": "How does the OAuth refresh token rotation work?",
50
+ "answer": "[AI-GENERATED ...] The refresh token is rotated each ...\n\nSources:\n[1] auth-spec.pdf — ...",
51
+ "session_id": "ses_…",
52
+ "notebook_url": "https://notebook.google.com/notebook/…",
53
+ "session_info": {
54
+ "age_seconds": 12,
55
+ "message_count": 3,
56
+ "last_activity": "2026-04-30T12:00:00.000Z"
57
+ },
58
+ "_provenance": {
59
+ "provider": "google-notebooklm",
60
+ "model": "google-managed",
61
+ "model_selection": "managed-by-notebooklm",
62
+ "via": "chrome-automation",
63
+ "grounding": "user-uploaded-documents",
64
+ "ai_generated": true
65
+ },
66
+ "source_format": "footnotes",
67
+ "sources": [
68
+ {
69
+ "marker": "[1]",
70
+ "number": 1,
71
+ "sourceName": "auth-spec.pdf",
72
+ "sourceText": "Refresh tokens MUST be rotated…",
73
+ "source_id": "source-42",
74
+ "source_name": "auth-spec.pdf",
75
+ "source_type": "pdf",
76
+ "source_url": null,
77
+ "location": { "page": 42 },
78
+ "excerpt": "Refresh tokens MUST be rotated…",
79
+ "extraction_status": "complete"
80
+ }
81
+ ]
82
+ }
83
+ ```
84
+
85
+ `sources` is omitted when `source_format=none` or when no citations were found. The camelCase fields remain for compatibility; v2.3 adds the structured snake_case fields. `extraction_status=partial` means the marker/name was detected but the excerpt panel could not be read within the shared eight-second budget.
86
+
87
+ ---
88
+
89
+ ## add_source — new in v2
90
+
91
+ Add a source to a notebook. v2.3 supports `type=url` (web crawl), `type=youtube` (public YouTube URL), and `type=text` (paste). File and Drive picker flows are not exposed yet.
92
+
93
+ ### Parameters
94
+
95
+ | Name | Type | Required | Notes |
96
+ |---|---|---|---|
97
+ | `type` | `url` \| `youtube` \| `text` | yes | |
98
+ | `content` | string | yes | HTTPS URL for URL/YouTube, raw text for text. |
99
+ | `title` | string | no | Optional display title. NotebookLM picks a default. |
100
+ | `session_id` | string | no | Reuse an existing browser session. |
101
+ | `notebook_id` | string | no | Library notebook ID. |
102
+ | `notebook_url` | string | no | Ad-hoc URL. Overrides `notebook_id`. |
103
+
104
+ ### Example
105
+
106
+ ```json
107
+ {
108
+ "name": "add_source",
109
+ "arguments": {
110
+ "type": "url",
111
+ "content": "https://docs.n8n.io/code/builtin/json-jmespath/",
112
+ "title": "n8n JMESPath builtin"
113
+ }
114
+ }
115
+ ```
116
+
117
+ ### Return shape
118
+
119
+ ```jsonc
120
+ {
121
+ "result": {
122
+ "success": true,
123
+ "type": "url",
124
+ "sourceCountBefore": 12,
125
+ "sourceCountAfter": 13,
126
+ "source": {
127
+ "source_id": "src_…",
128
+ "name": "n8n JMESPath builtin",
129
+ "type": "web",
130
+ "status": "ready"
131
+ }
132
+ }
133
+ }
134
+ ```
135
+
136
+ ---
137
+
138
+ ## list_sources / get_source / get_source_status — new in v2.3
139
+
140
+ `list_sources` inspects the live source sidebar and returns `{ sources, count }`. Each source contains `source_id`, `name`, inferred `type`, `status`, visible `url`, and `position`. `get_source` and its status-focused alias `get_source_status` accept either `source_id` or exact `name`, plus the normal notebook/session targeting fields. A missing source panel produces `UI_CHANGED`; it is not reported as an empty notebook.
141
+
142
+ ## batch_add_sources — new in v2.3
143
+
144
+ Accepts `sources` (1–25 objects with the same `type`, `content`, and optional `title` fields as `add_source`) and optional `stop_on_error` (default `true`). Returns `{ results, added, failed }` and reuses one authenticated notebook session.
145
+
146
+ ## generate_artifact / list_artifacts — new in v2.3
147
+
148
+ `generate_artifact` accepts `type: "audio_overview"`, optional `custom_prompt`, `wait_for_completion`, timeout, and notebook targeting. It returns a persistent job with `job_id`, `artifact_id`, `artifact_type`, `status`, and timestamps. `list_artifacts` reads those jobs without opening a browser and can filter by `notebook_id` or `notebook_url`.
149
+
150
+ ## get_artifact_status / download_artifact — new in v2.3
151
+
152
+ Both accept the persistent `job_id`. Status refreshes the live Audio Overview state; download additionally requires `destination_dir` under `NOTEBOOKLM_OUTPUT_DIR` and stores `file_path` in the job. Jobs are stored in `artifact-jobs.json` under `NOTEBOOKLM_DATA_DIR` and survive MCP reconnects.
153
+
154
+ The legacy `generate_audio`, `get_audio_status`, and `download_audio` tools remain available for compatibility.
155
+
156
+ ---
157
+
158
+ ## generate_audio — new in v2
159
+
160
+ Generate a podcast-style Audio Overview for a notebook. It returns immediately by default; pass `wait_for_completion=true` for synchronous waiting.
161
+
162
+ ### Parameters
163
+
164
+ | Name | Type | Required | Notes |
165
+ |---|---|---|---|
166
+ | `custom_prompt` | string | no | Optional focus prompt. |
167
+ | `timeout_ms` | number | no | Wait ceiling. Default `600000`. |
168
+ | `session_id` | string | no | |
169
+ | `notebook_id` | string | no | |
170
+ | `notebook_url` | string | no | |
171
+
172
+ ### Example
173
+
174
+ ```json
175
+ {
176
+ "name": "generate_audio",
177
+ "arguments": {
178
+ "custom_prompt": "Focus on the migration strategy",
179
+ "timeout_ms": 900000
180
+ }
181
+ }
182
+ ```
183
+
184
+ ### Return shape
185
+
186
+ ```jsonc
187
+ {
188
+ "status": "success",
189
+ "ready": true,
190
+ "duration_ms": 412000
191
+ }
192
+ ```
193
+
194
+ Pair with `download_audio` to persist the file. Video / Infographic / Slides are not currently exposed.
195
+
196
+ ---
197
+
198
+ ## download_audio — new in v2
199
+
200
+ Download the most recent Audio Overview to disk.
201
+
202
+ ### Parameters
203
+
204
+ | Name | Type | Required | Notes |
205
+ |---|---|---|---|
206
+ | `destination_dir` | string | yes | Directory under `NOTEBOOKLM_OUTPUT_DIR`; `.` selects the configured root. Created if missing. |
207
+ | `session_id` | string | no | |
208
+ | `notebook_id` | string | no | |
209
+ | `notebook_url` | string | no | |
210
+
211
+ ### Example
212
+
213
+ ```json
214
+ {
215
+ "name": "download_audio",
216
+ "arguments": {
217
+ "destination_dir": "."
218
+ }
219
+ }
220
+ ```
221
+
222
+ ### Return shape
223
+
224
+ ```jsonc
225
+ {
226
+ "status": "success",
227
+ "file_path": "<NOTEBOOKLM_OUTPUT_DIR>/overview-2026-04-30.m4a",
228
+ "size_bytes": 9_412_000
229
+ }
230
+ ```
231
+
232
+ Run `generate_audio` first if no Audio Overview exists yet.
233
+
234
+ ---
235
+
236
+ ## add_notebook
237
+
238
+ Add a NotebookLM share-URL to the local library. The tool description enforces a confirmation workflow on the host agent — do not call without explicit user consent.
239
+
240
+ ### Parameters
241
+
242
+ | Name | Type | Required | Notes |
243
+ |---|---|---|---|
244
+ | `url` | string | yes | NotebookLM share URL. |
245
+ | `name` | string | yes | Display name. |
246
+ | `description` | string | yes | Short description of the notebook content. |
247
+ | `topics` | string[] | yes | Topics covered. |
248
+ | `content_types` | string[] | no | e.g. `["documentation", "examples"]`. |
249
+ | `use_cases` | string[] | no | When to consult this notebook. |
250
+ | `tags` | string[] | no | Optional organizational tags. |
251
+
252
+ ### Return shape
253
+
254
+ ```jsonc
255
+ {
256
+ "status": "added",
257
+ "id": "nb_abcd",
258
+ "name": "n8n Documentation",
259
+ "active": true
260
+ }
261
+ ```
262
+
263
+ ---
264
+
265
+ ## list_notebooks
266
+
267
+ No parameters. Returns the full library.
268
+
269
+ ### Return shape
270
+
271
+ ```jsonc
272
+ {
273
+ "notebooks": [
274
+ {
275
+ "id": "1cf83fd8-91d2-43f2-b9dc-e3f159c2993d",
276
+ "slug": "n8n-documentation",
277
+ "google_notebook_id": "…",
278
+ "name": "n8n Documentation",
279
+ "url": "https://notebook.google.com/notebook/…",
280
+ "description": "n8n core + builtin nodes",
281
+ "topics": ["workflow automation", "n8n"],
282
+ "use_cases": ["building n8n workflows"],
283
+ "tags": ["docs"],
284
+ "use_count": 42,
285
+ "source_count": 18,
286
+ "sync_status": "available"
287
+ }
288
+ ]
289
+ }
290
+ ```
291
+
292
+ ---
293
+
294
+ ## list_account_notebooks
295
+
296
+ No parameters. Opens the live signed-in NotebookLM home grid and returns Google notebook IDs, names, URLs, visible modification text, and source counts.
297
+
298
+ ## import_account_notebook — new in v2.3
299
+
300
+ Requires `google_notebook_id` from `list_account_notebooks`. Optional `description`, `topics`, `content_types`, `use_cases`, and `tags` seed local metadata. Import is idempotent and stores a new local UUID separately from the Google ID.
301
+
302
+ ## sync_library — new in v2.3
303
+
304
+ Accepts optional `apply` (default `false`). Preview reports `added`, `updated`, `missing`, and `unchanged`. Applying adds account notebooks, tracks renames/source counts, and marks inaccessible notebooks as `missing`; it never deletes local entries.
305
+
306
+ ---
307
+
308
+ ## get_notebook
309
+
310
+ | Name | Type | Required |
311
+ |---|---|---|
312
+ | `id` | string | yes |
313
+
314
+ Returns one entry from `list_notebooks`.
315
+
316
+ ---
317
+
318
+ ## select_notebook
319
+
320
+ Set a notebook as the active default.
321
+
322
+ | Name | Type | Required |
323
+ |---|---|---|
324
+ | `id` | string | yes |
325
+
326
+ ### Return shape
327
+
328
+ ```jsonc
329
+ { "status": "active", "id": "nb_abcd", "name": "n8n Documentation" }
330
+ ```
331
+
332
+ ---
333
+
334
+ ## update_notebook
335
+
336
+ | Name | Type | Required |
337
+ |---|---|---|
338
+ | `id` | string | yes |
339
+ | `name` | string | no |
340
+ | `description` | string | no |
341
+ | `topics` | string[] | no |
342
+ | `content_types` | string[] | no |
343
+ | `use_cases` | string[] | no |
344
+ | `tags` | string[] | no |
345
+ | `url` | string | no |
346
+
347
+ Returns the updated entry.
348
+
349
+ ---
350
+
351
+ ## remove_notebook
352
+
353
+ Removes the entry from the local library only — does not delete the notebook in NotebookLM.
354
+
355
+ | Name | Type | Required |
356
+ |---|---|---|
357
+ | `id` | string | yes |
358
+
359
+ ---
360
+
361
+ ## search_notebooks
362
+
363
+ Searches name, description, topics, tags.
364
+
365
+ | Name | Type | Required |
366
+ |---|---|---|
367
+ | `query` | string | yes |
368
+
369
+ Returns an array of matching entries.
370
+
371
+ ---
372
+
373
+ ## get_library_stats
374
+
375
+ No parameters. Returns total notebooks, total queries, top-used notebooks.
376
+
377
+ ---
378
+
379
+ ## list_sessions
380
+
381
+ No parameters. Returns active sessions with age, message count, last-activity timestamp.
382
+
383
+ ---
384
+
385
+ ## close_session
386
+
387
+ | Name | Type | Required |
388
+ |---|---|---|
389
+ | `session_id` | string | yes |
390
+
391
+ ---
392
+
393
+ ## reset_session
394
+
395
+ Clears chat history while keeping the same `session_id`.
396
+
397
+ | Name | Type | Required |
398
+ |---|---|---|
399
+ | `session_id` | string | yes |
400
+
401
+ ---
402
+
403
+ ## get_health
404
+
405
+ No parameters.
406
+
407
+ ### Return shape
408
+
409
+ ```jsonc
350
410
  {
351
411
  "status": "ok",
352
412
  "auth_state_present": true,
353
413
  "authenticated": null,
354
414
  "authentication_check": "Authentication is verified when opening NotebookLM",
355
415
  "active_sessions": 1,
356
- "version": "2.0.0",
357
- "config": {
358
- "headless": true,
359
- "stealth_enabled": true,
360
- "max_sessions": 10,
361
- "answer_timeout_ms": 600000
362
- }
363
- }
364
- ```
365
-
416
+ "version": "2.0.0",
417
+ "config": {
418
+ "headless": true,
419
+ "stealth_enabled": true,
420
+ "max_sessions": 10,
421
+ "answer_timeout_ms": 600000
422
+ }
423
+ }
424
+ ```
425
+
366
426
  `auth_state_present` means that `state.json` exists, is readable, and contains a
367
427
  cookie array. It is not proof that Google currently accepts those cookies.
368
428
  `authenticated` is therefore `null`; live authentication is checked when a
369
429
  browser-driven NotebookLM tool opens the service. A missing backup may produce a
370
430
  non-destructive tip, but never justifies `re_auth` or `cleanup_data` by itself.
371
-
372
- ---
373
-
374
- ## setup_auth
375
-
376
- Opens a visible Chrome for first-time Google login.
377
-
378
- | Name | Type | Required | Notes |
379
- |---|---|---|---|
380
- | `show_browser` | bool | no | Default `true` for setup. |
381
- | `browser_options` | object | no | Same shape as `ask_question`. |
382
-
383
- Returns immediately after the window is opened. The user has up to 10 minutes to complete the login. Verify with `get_health` afterwards.
384
-
385
- ---
386
-
387
- ## re_auth
388
-
389
- Closes all sessions, deletes saved cookies + Chrome profile, opens a fresh login window.
390
-
391
- | Name | Type | Required | Notes |
392
- |---|---|---|---|
393
- | `show_browser` | bool | no | Default `true`. |
394
- | `browser_options` | object | no | |
395
-
396
- ---
397
-
398
- ## cleanup_data
399
-
400
- Categorised preview + delete of every NotebookLM MCP file the server can find on the system. Designed for fresh-start workflows.
401
-
402
- | Name | Type | Required | Notes |
403
- |---|---|---|---|
404
- | `confirm` | bool | yes | `false` = preview only. `true` = delete after preview was reviewed. |
405
- | `preserve_library` | bool | no | Keep `library.json` while wiping everything else. Default `false`. |
406
-
407
- Workflow:
408
-
409
- 1. `cleanup_data({ confirm: false, preserve_library: true })` — see what will be deleted.
410
- 2. Close all Chrome instances.
411
- 3. `cleanup_data({ confirm: true, preserve_library: true })` — execute.
412
-
413
- ---
414
-
415
- ## Resources (read-only)
416
-
417
- | URI | Purpose |
418
- |---|---|
419
- | `notebooklm://library` | JSON view of the full library. |
420
- | `notebooklm://library/{id}` | One notebook by ID. The `{id}` template autocompletes from the library. |
421
- | `notebooklm://metadata` | Deprecated. Use `notebooklm://library` instead. |
422
-
423
- The MCP server does not respond to `mcp://notebooklm` — that URI scheme never existed. Use `notebooklm://`.
431
+
432
+ ---
433
+
434
+ ## setup_auth
435
+
436
+ Opens a visible Chrome for first-time Google login.
437
+
438
+ | Name | Type | Required | Notes |
439
+ |---|---|---|---|
440
+ | `show_browser` | bool | no | Default `true` for setup. |
441
+ | `browser_options` | object | no | Same shape as `ask_question`. |
442
+
443
+ The call waits for login completion for up to 10 minutes and reports progress. A subsequent NotebookLM operation performs the live authentication check; `get_health` only reports saved-state presence.
444
+
445
+ ---
446
+
447
+ ## re_auth
448
+
449
+ Closes all sessions, deletes saved cookies + Chrome profile, opens a fresh login window.
450
+
451
+ | Name | Type | Required | Notes |
452
+ |---|---|---|---|
453
+ | `show_browser` | bool | no | Default `true`. |
454
+ | `browser_options` | object | no | |
455
+
456
+ ---
457
+
458
+ ## cleanup_data
459
+
460
+ Preview + deletion restricted to the configured `NOTEBOOKLM_DATA_DIR`. The tool never scans or deletes npm caches, Claude/Cursor/VS Code data, system temporary files, or trash.
461
+
462
+ | Name | Type | Required | Notes |
463
+ |---|---|---|---|
464
+ | `confirm` | bool | yes | `false` = preview only. `true` = execute using the preview token. |
465
+ | `preserve_library` | bool | no | Keep `library.json` while wiping everything else. Default `false`. |
466
+ | `preview_token` | string | when confirming | Expiring one-time token returned by the preview. |
467
+
468
+ Workflow:
469
+
470
+ 1. `cleanup_data({ confirm: false, preserve_library: true })` — review paths, digest, and expiry.
471
+ 2. Close all browser sessions.
472
+ 3. `cleanup_data({ confirm: true, preview_token: "..." })` — execute only if the manifest is unchanged.
473
+
474
+ ---
475
+
476
+ ## Resources (read-only)
477
+
478
+ | URI | Purpose |
479
+ |---|---|
480
+ | `notebooklm://library` | JSON view of the full library. |
481
+ | `notebooklm://library/{id}` | One notebook by ID. The `{id}` template autocompletes from the library. |
482
+ | `notebooklm://metadata` | Deprecated. Use `notebooklm://library` instead. |
483
+
484
+ The MCP server does not respond to `mcp://notebooklm` — that URI scheme never existed. Use `notebooklm://`.