Skip to content

Fatal crash: Cannot read properties of undefined (reading 'join') when notebook exists in library #33

@obaind

Description

@obaind

Bug Description

When any notebook is added to the library, the MCP server crashes on startup with:

TypeError: Cannot read properties of undefined (reading 'join')
    at buildAskQuestionDescription (notebooklm-mcp/dist/tools/definitions/ask-question.js:8:38)
    at buildToolDefinitions (notebooklm-mcp/dist/tools/definitions.js:17:22)

Steps to Reproduce

  1. Install via npx notebooklm-mcp@latest (also tested with @1.2.1)
  2. Run setup_auth - works fine
  3. Run add_notebook(url: "...", name: "Test", tags: ["test"]) - works fine
  4. Run ask_question(question: "...") - crashes

Expected Behavior

Should query the notebook and return a response.

Actual Behavior

Server crashes immediately on any tool call once a notebook exists in library.json.

Environment

  • macOS (arm64)
  • Node.js v25.4.0
  • notebooklm-mcp v1.2.1 (also tested v1.0.0)
  • Using via mcporter MCP client

Workaround

Deleting ~/Library/Application Support/notebooklm-mcp/library.json allows the server to start, but then notebooks can't be used.

Library.json Content (when crash occurs)

{
  "notebooks": [{
    "id": "test",
    "url": "https://notebooklm.google.com/notebook/...",
    "name": "Test",
    "content_types": ["documentation", "examples"],
    "use_cases": ["Learning about Test", "Implementing features with Test"],
    "tags": ["test"],
    ...
  }],
  "active_notebook_id": "test",
  ...
}

Seems like buildAskQuestionDescription is accessing an undefined property and calling .join() on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions