Skip to main content
Glama

source_add

Add sources to a NotebookLM notebook—supporting URLs, YouTube, text, files, and Drive documents—individually or in batch, with optional waiting for processing.

Instructions

Add a source to a notebook — single, batch, or in-channel bytes. Accepts a notebook name or ID.

Call in exactly ONE of two modes:

Single mode — pass source_type; it selects the required input:

  • url / youtube — require url (youtube → a YouTube link).

  • text — requires text; title optional.

  • file — over stdio, requires path (a local path on the server host). Over the remote (http) connector the host filesystem is unreachable, so it returns upload_required with two actor paths: human_upload (open the signed URL in a browser) and agent_upload (an agent POSTs the bytes as the raw body); agent_instructions gives the rule (try agent_upload, else human_upload.url). Alternatively pass bytes_base64 to add a SMALL file in-channel (any transport, no signed URL): standard base64 (not URL-safe) ≤ 10,000 chars (≈ 7 KB); filename seeds the title/extension. A bigger file must take the signed URL (≤ 200 MiB).

  • drive — requires document_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).

Batch mode — pass urls (a list of http/https URLs, YouTube links included) to add many in one call instead of one round-trip each. Each entry is validated and added independently; the response is an explicit per-item list so partial failure is never hidden::

{"notebook_id": …, "added": <int>, "failed": <int>,
 "results": [{"input": "<url>", "status": "added", "source_id": …,
              "title": …, "status_label": …, "warning"?: …},
             {"input": "<url>", "status": "error",
              "error": {"code": …, "message": …, "retriable": …, "hint"?: …}}]}

results is positional (results[i] is for urls[i]); status is "added" or "error" (the ADD outcome). An "added" item also carries the source's status_label and, when the add response already reflects a failed import, an inline warning — same failure-signaling as single mode. A per-URL input failure (bad URL / 404 / SSRF-blocked host) isolates as an error item; a fatal service failure (expired auth, rate limit, upstream 5xx) aborts the whole call. Batch is URL-only: a non-URL entry (plain text, a local path, file:///ftp://) is reported as a per-item VALIDATION error. The single-mode named inputs (incl. bytes_base64/filename/wait) are not valid with urls; allow_internal applies to every entry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo
pathNo
textNo
urlsNo
waitNo
titleNo
timeoutNo
filenameNo
intervalNo
notebookYes
mime_typeNo
document_idNo
source_typeNo
bytes_base64No
allow_internalNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully carries the burden and does so thoroughly: discloses async import behavior, partial-failure isolation in batch, upload_required flow, transport-specific filesystem limits, base64 size cap, title override behavior, and error signaling (inline warnings, status_label). Even details timeout/interval polling semantics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Although long, the description is well-structured with headers, bullet lists, and a code block for the batch response. Every section adds distinct, non-redundant value. Issue references add traceability without bloating. The front-loaded purpose makes the tool immediately understandable despite its complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 15 parameters, no output schema, and no annotations, the description is remarkably complete: covers return formats for both modes, error handling, async status, size limits, transport differences, and wait polling. It leaves no significant gap for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet every parameter is explained in context: source_type picks required inputs, wait/timeout/interval, notebook, mime_type, document_id, bytes_base64, filename, urls, allow_internal, title. Constraints like mutual exclusivity and base64 length limits are explicitly stated, which is essential for correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource: 'Add a source to a notebook — single, batch, or in-channel bytes.' Clearly identifies the action and scope, and distinguishes from siblings like source_delete/source_list. Accepts a notebook name or ID, which is a necessary qualifier.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit mode selection rules: single vs batch, when wait should be used, and clear exclusions (e.g., wait is not for remote file signed-URL uploads; batch rejects non-URL entries). References source_wait and source_list as complements. Does not explicitly mention the sibling source_add_drive_file, but the drive mode is fully covered via source_type='drive'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Solar2004/nblm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server