Skip to content

Fix AttributeError: use sources_count instead of source_count#4

Open
crugalde wants to merge 1 commit into
alfredang:mainfrom
crugalde:fix/sources-count-attribute
Open

Fix AttributeError: use sources_count instead of source_count#4
crugalde wants to merge 1 commit into
alfredang:mainfrom
crugalde:fix/sources-count-attribute

Conversation

@crugalde
Copy link
Copy Markdown

Problem

Calling list_notebooks via the MCP tool raises:

AttributeError: 'Notebook' object has no attribute 'source_count'

Root cause

The Notebook object returned by notebooklm-py exposes the attribute as sources_count (plural), not source_count. Confirmed via runtime introspection:

>>> nb.model_dump()
{'id': '...', 'title': '...', 'created_at': ..., 'sources_count': 0, 'is_owner': True}

Fix

One-line change in server.py to use the correct attribute name in the list_notebooks tool's response.

Verification

  • Reproduced the original error end-to-end via Claude Desktop → MCP server → list_notebooks (returned isError: true with the AttributeError).
  • Applied the fix; restarted the MCP server.
  • Re-invoked from Claude Desktop chat; tool now returns isError: false with the full notebook list (verified with 36 notebooks).

Created via Warp: https://app.warp.dev/conversation/886ab47d-482a-482c-9c85-3b22f15c10ad

Co-Authored-By: Oz oz-agent@warp.dev

The NotebookLM Notebook object exposes 'sources_count' (plural), not
'source_count'. Calling list_notebooks via the MCP tool raised:

  AttributeError: 'Notebook' object has no attribute 'source_count'

Confirmed via runtime introspection that the correct attribute is
sources_count.

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant