@charlie.act7/gemini-notebook-mcp 2.1.3 → 2.3.1

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 (85) hide show
  1. package/README.md +467 -434
  2. package/dist/auth/auth-manager.d.ts +2 -2
  3. package/dist/auth/auth-manager.d.ts.map +1 -1
  4. package/dist/auth/auth-manager.js +27 -26
  5. package/dist/auth/auth-manager.js.map +1 -1
  6. package/dist/errors.d.ts +10 -1
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +19 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/index.js +53 -17
  11. package/dist/index.js.map +1 -1
  12. package/dist/library/notebook-library.d.ts +7 -3
  13. package/dist/library/notebook-library.d.ts.map +1 -1
  14. package/dist/library/notebook-library.js +162 -14
  15. package/dist/library/notebook-library.js.map +1 -1
  16. package/dist/library/types.d.ts +18 -0
  17. package/dist/library/types.d.ts.map +1 -1
  18. package/dist/notebooklm/artifact-store.d.ts +26 -0
  19. package/dist/notebooklm/artifact-store.d.ts.map +1 -0
  20. package/dist/notebooklm/artifact-store.js +102 -0
  21. package/dist/notebooklm/artifact-store.js.map +1 -0
  22. package/dist/notebooklm/audio.d.ts.map +1 -1
  23. package/dist/notebooklm/audio.js +13 -37
  24. package/dist/notebooklm/audio.js.map +1 -1
  25. package/dist/notebooklm/chat.d.ts.map +1 -1
  26. package/dist/notebooklm/chat.js +22 -14
  27. package/dist/notebooklm/chat.js.map +1 -1
  28. package/dist/notebooklm/citations.d.ts +17 -22
  29. package/dist/notebooklm/citations.d.ts.map +1 -1
  30. package/dist/notebooklm/citations.js +148 -115
  31. package/dist/notebooklm/citations.js.map +1 -1
  32. package/dist/notebooklm/selectors.d.ts +56 -2
  33. package/dist/notebooklm/selectors.d.ts.map +1 -1
  34. package/dist/notebooklm/selectors.js +120 -2
  35. package/dist/notebooklm/selectors.js.map +1 -1
  36. package/dist/notebooklm/sources.d.ts +16 -1
  37. package/dist/notebooklm/sources.d.ts.map +1 -1
  38. package/dist/notebooklm/sources.js +123 -27
  39. package/dist/notebooklm/sources.js.map +1 -1
  40. package/dist/session/browser-session.d.ts +15 -9
  41. package/dist/session/browser-session.d.ts.map +1 -1
  42. package/dist/session/browser-session.js +123 -154
  43. package/dist/session/browser-session.js.map +1 -1
  44. package/dist/session/session-manager.d.ts +1 -1
  45. package/dist/session/session-manager.d.ts.map +1 -1
  46. package/dist/session/session-manager.js +55 -37
  47. package/dist/session/session-manager.js.map +1 -1
  48. package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
  49. package/dist/tools/definitions/notebook-management.js +43 -0
  50. package/dist/tools/definitions/notebook-management.js.map +1 -1
  51. package/dist/tools/definitions/sources.d.ts +8 -0
  52. package/dist/tools/definitions/sources.d.ts.map +1 -1
  53. package/dist/tools/definitions/sources.js +144 -8
  54. package/dist/tools/definitions/sources.js.map +1 -1
  55. package/dist/tools/handlers.d.ts +94 -13
  56. package/dist/tools/handlers.d.ts.map +1 -1
  57. package/dist/tools/handlers.js +222 -19
  58. package/dist/tools/handlers.js.map +1 -1
  59. package/dist/tools/validation.d.ts.map +1 -1
  60. package/dist/tools/validation.js +108 -1
  61. package/dist/tools/validation.js.map +1 -1
  62. package/dist/transport/http.d.ts +2 -0
  63. package/dist/transport/http.d.ts.map +1 -1
  64. package/dist/transport/http.js +4 -0
  65. package/dist/transport/http.js.map +1 -1
  66. package/dist/types.d.ts +11 -0
  67. package/dist/types.d.ts.map +1 -1
  68. package/dist/utils/live-smoke.d.ts +18 -0
  69. package/dist/utils/live-smoke.d.ts.map +1 -0
  70. package/dist/utils/live-smoke.js +36 -0
  71. package/dist/utils/live-smoke.js.map +1 -0
  72. package/dist/utils/operation.d.ts +8 -0
  73. package/dist/utils/operation.d.ts.map +1 -0
  74. package/dist/utils/operation.js +42 -0
  75. package/dist/utils/operation.js.map +1 -0
  76. package/dist/utils/page-utils.d.ts.map +1 -1
  77. package/dist/utils/page-utils.js +3 -3
  78. package/dist/utils/page-utils.js.map +1 -1
  79. package/docs/configuration.md +184 -182
  80. package/docs/implementation-plan.md +50 -2
  81. package/docs/project-status.md +159 -0
  82. package/docs/tools.md +469 -410
  83. package/docs/troubleshooting.md +176 -176
  84. package/docs/usage-guide.md +285 -285
  85. package/package.json +76 -69
package/docs/tools.md CHANGED
@@ -1,425 +1,484 @@
1
- # Tools
2
-
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
+
3
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.
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",
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",
56
60
  "model": "google-managed",
57
61
  "model_selection": "managed-by-notebooklm",
58
- "via": "chrome-automation",
59
- "grounding": "user-uploaded-documents",
60
- "ai_generated": true
61
- },
62
- "source_format": "footnotes",
63
- "sources": [
64
- { "index": 1, "title": "auth-spec.pdf", "excerpt": "Refresh tokens MUST be rotated…" }
65
- ]
66
- }
67
- ```
68
-
69
- `sources` is omitted when `source_format=none` or when no citations were found.
70
-
71
- ---
72
-
73
- ## add_source — new in v2
74
-
75
- Add a source to a notebook. v2 supports `type=url` (web crawl) and `type=text` (paste). File / YouTube / Drive uploads are not supported.
76
-
77
- ### Parameters
78
-
79
- | Name | Type | Required | Notes |
80
- |---|---|---|---|
81
- | `type` | `url` \| `text` | yes | |
82
- | `content` | string | yes | URL when `type=url`, raw text when `type=text`. |
83
- | `title` | string | no | Optional display title. NotebookLM picks a default. |
84
- | `session_id` | string | no | Reuse an existing browser session. |
85
- | `notebook_id` | string | no | Library notebook ID. |
86
- | `notebook_url` | string | no | Ad-hoc URL. Overrides `notebook_id`. |
87
-
88
- ### Example
89
-
90
- ```json
91
- {
92
- "name": "add_source",
93
- "arguments": {
94
- "type": "url",
95
- "content": "https://docs.n8n.io/code/builtin/json-jmespath/",
96
- "title": "n8n JMESPath builtin"
97
- }
98
- }
99
- ```
100
-
101
- ### Return shape
102
-
103
- ```jsonc
104
- {
105
- "status": "success",
106
- "type": "url",
107
- "title": "n8n JMESPath builtin",
108
- "source_count_before": 12,
109
- "source_count_after": 13,
110
- "added": true
111
- }
112
- ```
113
-
114
- ---
115
-
116
- ## generate_audio — new in v2
117
-
118
- Generate a podcast-style Audio Overview for a notebook. Resolves when the audio element is ready.
119
-
120
- ### Parameters
121
-
122
- | Name | Type | Required | Notes |
123
- |---|---|---|---|
124
- | `custom_prompt` | string | no | Optional focus prompt. |
125
- | `timeout_ms` | number | no | Wait ceiling. Default `600000`. |
126
- | `session_id` | string | no | |
127
- | `notebook_id` | string | no | |
128
- | `notebook_url` | string | no | |
129
-
130
- ### Example
131
-
132
- ```json
133
- {
134
- "name": "generate_audio",
135
- "arguments": {
136
- "custom_prompt": "Focus on the migration strategy",
137
- "timeout_ms": 900000
138
- }
139
- }
140
- ```
141
-
142
- ### Return shape
143
-
144
- ```jsonc
145
- {
146
- "status": "success",
147
- "ready": true,
148
- "duration_ms": 412000
149
- }
150
- ```
151
-
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
+
152
194
  Pair with `download_audio` to persist the file. Video / Infographic / Slides are not currently exposed.
153
-
154
- ---
155
-
156
- ## download_audio — new in v2
157
-
158
- Download the most recent Audio Overview to disk.
159
-
160
- ### Parameters
161
-
162
- | Name | Type | Required | Notes |
163
- |---|---|---|---|
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
+ |---|---|---|---|
164
206
  | `destination_dir` | string | yes | Directory under `NOTEBOOKLM_OUTPUT_DIR`; `.` selects the configured root. Created if missing. |
165
- | `session_id` | string | no | |
166
- | `notebook_id` | string | no | |
167
- | `notebook_url` | string | no | |
168
-
169
- ### Example
170
-
171
- ```json
172
- {
173
- "name": "download_audio",
174
- "arguments": {
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": {
175
217
  "destination_dir": "."
176
- }
177
- }
178
- ```
179
-
180
- ### Return shape
181
-
182
- ```jsonc
183
- {
184
- "status": "success",
218
+ }
219
+ }
220
+ ```
221
+
222
+ ### Return shape
223
+
224
+ ```jsonc
225
+ {
226
+ "status": "success",
185
227
  "file_path": "<NOTEBOOKLM_OUTPUT_DIR>/overview-2026-04-30.m4a",
186
- "size_bytes": 9_412_000
187
- }
188
- ```
189
-
190
- Run `generate_audio` first if no Audio Overview exists yet.
191
-
192
- ---
193
-
194
- ## add_notebook
195
-
196
- 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.
197
-
198
- ### Parameters
199
-
200
- | Name | Type | Required | Notes |
201
- |---|---|---|---|
202
- | `url` | string | yes | NotebookLM share URL. |
203
- | `name` | string | yes | Display name. |
204
- | `description` | string | yes | Short description of the notebook content. |
205
- | `topics` | string[] | yes | Topics covered. |
206
- | `content_types` | string[] | no | e.g. `["documentation", "examples"]`. |
207
- | `use_cases` | string[] | no | When to consult this notebook. |
208
- | `tags` | string[] | no | Optional organizational tags. |
209
-
210
- ### Return shape
211
-
212
- ```jsonc
213
- {
214
- "status": "added",
215
- "id": "nb_abcd",
216
- "name": "n8n Documentation",
217
- "active": true
218
- }
219
- ```
220
-
221
- ---
222
-
223
- ## list_notebooks
224
-
225
- No parameters. Returns the full library.
226
-
227
- ### Return shape
228
-
229
- ```jsonc
230
- {
231
- "active_notebook_id": "nb_abcd",
232
- "notebooks": [
233
- {
234
- "id": "nb_abcd",
235
- "name": "n8n Documentation",
236
- "url": "https://notebook.google.com/notebook/…",
237
- "description": "n8n core + builtin nodes",
238
- "topics": ["workflow automation", "n8n"],
239
- "use_cases": ["building n8n workflows"],
240
- "tags": ["docs"],
241
- "use_count": 42
242
- }
243
- ]
244
- }
245
- ```
246
-
247
- ---
248
-
249
- ## get_notebook
250
-
251
- | Name | Type | Required |
252
- |---|---|---|
253
- | `id` | string | yes |
254
-
255
- Returns one entry from `list_notebooks`.
256
-
257
- ---
258
-
259
- ## select_notebook
260
-
261
- Set a notebook as the active default.
262
-
263
- | Name | Type | Required |
264
- |---|---|---|
265
- | `id` | string | yes |
266
-
267
- ### Return shape
268
-
269
- ```jsonc
270
- { "status": "active", "id": "nb_abcd", "name": "n8n Documentation" }
271
- ```
272
-
273
- ---
274
-
275
- ## update_notebook
276
-
277
- | Name | Type | Required |
278
- |---|---|---|
279
- | `id` | string | yes |
280
- | `name` | string | no |
281
- | `description` | string | no |
282
- | `topics` | string[] | no |
283
- | `content_types` | string[] | no |
284
- | `use_cases` | string[] | no |
285
- | `tags` | string[] | no |
286
- | `url` | string | no |
287
-
288
- Returns the updated entry.
289
-
290
- ---
291
-
292
- ## remove_notebook
293
-
294
- Removes the entry from the local library only — does not delete the notebook in NotebookLM.
295
-
296
- | Name | Type | Required |
297
- |---|---|---|
298
- | `id` | string | yes |
299
-
300
- ---
301
-
302
- ## search_notebooks
303
-
304
- Searches name, description, topics, tags.
305
-
306
- | Name | Type | Required |
307
- |---|---|---|
308
- | `query` | string | yes |
309
-
310
- Returns an array of matching entries.
311
-
312
- ---
313
-
314
- ## get_library_stats
315
-
316
- No parameters. Returns total notebooks, total queries, top-used notebooks.
317
-
318
- ---
319
-
320
- ## list_sessions
321
-
322
- No parameters. Returns active sessions with age, message count, last-activity timestamp.
323
-
324
- ---
325
-
326
- ## close_session
327
-
328
- | Name | Type | Required |
329
- |---|---|---|
330
- | `session_id` | string | yes |
331
-
332
- ---
333
-
334
- ## reset_session
335
-
336
- Clears chat history while keeping the same `session_id`.
337
-
338
- | Name | Type | Required |
339
- |---|---|---|
340
- | `session_id` | string | yes |
341
-
342
- ---
343
-
344
- ## get_health
345
-
346
- No parameters.
347
-
348
- ### Return shape
349
-
350
- ```jsonc
351
- {
352
- "status": "ok",
353
- "auth_state_present": true,
354
- "authenticated": null,
355
- "authentication_check": "Authentication is verified when opening NotebookLM",
356
- "active_sessions": 1,
357
- "version": "2.0.0",
358
- "config": {
359
- "headless": true,
360
- "stealth_enabled": true,
361
- "max_sessions": 10,
362
- "answer_timeout_ms": 600000
363
- }
364
- }
365
- ```
366
-
367
- `auth_state_present` means that `state.json` exists, is readable, and contains a
368
- cookie array. It is not proof that Google currently accepts those cookies.
369
- `authenticated` is therefore `null`; live authentication is checked when a
370
- browser-driven NotebookLM tool opens the service. A missing backup may produce a
371
- non-destructive tip, but never justifies `re_auth` or `cleanup_data` by itself.
372
-
373
- ---
374
-
375
- ## setup_auth
376
-
377
- Opens a visible Chrome for first-time Google login.
378
-
379
- | Name | Type | Required | Notes |
380
- |---|---|---|---|
381
- | `show_browser` | bool | no | Default `true` for setup. |
382
- | `browser_options` | object | no | Same shape as `ask_question`. |
383
-
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
410
+ {
411
+ "status": "ok",
412
+ "auth_state_present": true,
413
+ "authenticated": null,
414
+ "authentication_check": "Authentication is verified when opening NotebookLM",
415
+ "active_sessions": 1,
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
+
426
+ `auth_state_present` means that `state.json` exists, is readable, and contains a
427
+ cookie array. It is not proof that Google currently accepts those cookies.
428
+ `authenticated` is therefore `null`; live authentication is checked when a
429
+ browser-driven NotebookLM tool opens the service. A missing backup may produce a
430
+ non-destructive tip, but never justifies `re_auth` or `cleanup_data` by itself.
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
+
384
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.
385
-
386
- ---
387
-
388
- ## re_auth
389
-
390
- Closes all sessions, deletes saved cookies + Chrome profile, opens a fresh login window.
391
-
392
- | Name | Type | Required | Notes |
393
- |---|---|---|---|
394
- | `show_browser` | bool | no | Default `true`. |
395
- | `browser_options` | object | no | |
396
-
397
- ---
398
-
399
- ## cleanup_data
400
-
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
+
401
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.
402
-
403
- | Name | Type | Required | Notes |
404
- |---|---|---|---|
461
+
462
+ | Name | Type | Required | Notes |
463
+ |---|---|---|---|
405
464
  | `confirm` | bool | yes | `false` = preview only. `true` = execute using the preview token. |
406
465
  | `preserve_library` | bool | no | Keep `library.json` while wiping everything else. Default `false`. |
407
466
  | `preview_token` | string | when confirming | Expiring one-time token returned by the preview. |
408
-
409
- Workflow:
410
-
467
+
468
+ Workflow:
469
+
411
470
  1. `cleanup_data({ confirm: false, preserve_library: true })` — review paths, digest, and expiry.
412
471
  2. Close all browser sessions.
413
472
  3. `cleanup_data({ confirm: true, preview_token: "..." })` — execute only if the manifest is unchanged.
414
-
415
- ---
416
-
417
- ## Resources (read-only)
418
-
419
- | URI | Purpose |
420
- |---|---|
421
- | `notebooklm://library` | JSON view of the full library. |
422
- | `notebooklm://library/{id}` | One notebook by ID. The `{id}` template autocompletes from the library. |
423
- | `notebooklm://metadata` | Deprecated. Use `notebooklm://library` instead. |
424
-
425
- The MCP server does not respond to `mcp://notebooklm` — that URI scheme never existed. Use `notebooklm://`.
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://`.