source_add
Adds URLs, YouTube links, text, files, or Google Drive documents to a NotebookLM notebook by name or ID; supports batch URL imports and small base64 file uploads.
Instructions
Add sources by notebook name or ID: single, batch, or in-channel bytes.
Choose ONE mode:
Single mode — pass source_type; it selects the required input:
url/youtube— requireurl(youtube→ a YouTube link).text— requirestext;titleoptional.file— over stdio, requirespath(a local path on the server host insideNOTEBOOKLM_MCP_ALLOWED_ROOTS; host-path file-add is off until that env is set — not$HOMEand not~/.notebooklm). Over the remote (http) connector the host filesystem is unreachable, so it returnsupload_requiredwith two actor paths:human_upload(open the signed URL in a browser) andagent_upload(an agent POSTs the bytes as the raw body);agent_instructionsgives the rule (tryagent_upload, elsehuman_upload.url). Alternatively passbytes_base64to add a SMALL file in-channel (any transport, no signed URL): standard base64 (not URL-safe) ≤ 10,000 chars (≈ 7 KB);filenameseeds the title/extension. A bigger file must take the signed URL (≤ 200 MiB).drive— requiresdocument_id+mime_type(one of google-doc|google-slides|google-sheets|pdf; required, no default — a wrong default fails non-Doc imports, #1827).
The single-mode content inputs are mutually exclusive — supply only the one
your source_type requires (bytes_base64 is the file alternative to
path). An explicit title for url/youtube/drive is honored via a post-add
rename; a miss returns title_override_applied: false (#1960).
Pass wait=true to block until the ONE added source finishes processing and
return the source_wait aggregate (buckets + per-bucket *_count +
total_count) with a top-level source_id (present even on timeout/failure);
timeout/interval tune the poll. wait is single-mode only and NOT for a
remote file signed-URL upload (add it, then source_wait). Without wait
the added source is echoed under source with string kind /
status_label labels; imports are ASYNCHRONOUS so the echo is usually still
processing/preparing — confirm with source_wait or
source_list(status="error"). A failed import is flagged inline
(status_label="error" + a warning); source_wait also flags a READY web
page with suspiciously thin text (dead link/soft-404/paywall).
Single web URLs support fallback_fetch=True: eligible connection failures
become static text with fallback provenance (impersonate + markdown extras).
cleanup_on_failure=True additionally deletes the attributable failed stub
once its replacement is ready. Private fetch destinations are blocked.
Batch mode — pass urls (http/https, including YouTube). Returns
notebook_id, added/failed counts and per-input results with
input, status (added/error), source fields or an error object.
results[i] corresponds to urls[i] and includes commit_state
(confirmed/rejected/unknown/not_sent). Batch is URL-only; invalid entries are
not_sent errors. Escaping failures retain settled members as batch_outcome.
Single-mode inputs and wait are invalid with urls; allow_internal
applies to every entry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| path | No | ||
| text | No | ||
| urls | No | ||
| wait | No | ||
| title | No | ||
| timeout | No | ||
| filename | No | ||
| interval | No | ||
| notebook | Yes | ||
| mime_type | No | ||
| document_id | No | ||
| source_type | No | ||
| bytes_base64 | No | ||
| allow_internal | No | ||
| fallback_fetch | No | ||
| cleanup_on_failure | No |