Skip to main content
Glama

remove_notebook

Remove a notebook from your NotebookLM library after explicit user confirmation. This action only removes the notebook reference from the library interface without deleting the actual NotebookLM notebook content.

Instructions

Dangerous — requires explicit user confirmation.

Confirmation Workflow

  1. User requests removal ("Remove the React notebook")

  2. Look up full name to confirm

  3. Ask: "Remove '[notebook_name]' from your library? (Does not delete the actual NotebookLM notebook)"

  4. Only on explicit "Yes" → call remove_notebook

Never remove without permission or based on assumptions.

Example: User: "Delete the old React notebook" You: "Remove 'React Best Practices' from your library?" User: "Yes" → call remove_notebook

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe notebook ID to remove

Implementation Reference

  • Main handler function executing the remove_notebook tool: validates notebook exists, removes it via library, closes associated sessions, handles errors, returns success/error with closed_sessions count.
    /**
     * Handle remove_notebook tool
     */
    async handleRemoveNotebook(args: { id: string }): Promise<ToolResult<{ removed: boolean; closed_sessions: number }>> {
      log.info(`🔧 [TOOL] remove_notebook called`);
      log.info(`  ID: ${args.id}`);
    
      try {
        const notebook = this.library.getNotebook(args.id);
        if (!notebook) {
          log.warning(`⚠️  [TOOL] Notebook not found: ${args.id}`);
          return {
            success: false,
            error: `Notebook not found: ${args.id}`,
          };
        }
    
        const removed = this.library.removeNotebook(args.id);
        if (removed) {
          const closedSessions = await this.sessionManager.closeSessionsForNotebook(
            notebook.url
          );
          log.success(`✅ [TOOL] remove_notebook completed`);
          return {
            success: true,
            data: { removed: true, closed_sessions: closedSessions },
          };
        } else {
          log.warning(`⚠️  [TOOL] Notebook not found: ${args.id}`);
          return {
            success: false,
            error: `Notebook not found: ${args.id}`,
          };
        }
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        log.error(`❌ [TOOL] remove_notebook failed: ${errorMessage}`);
        return {
          success: false,
          error: errorMessage,
        };
      }
    }
  • Tool schema definition: name, detailed description with confirmation workflow, input schema requiring 'id' string.
      {
        name: "remove_notebook",
        description:
          `Dangerous — requires explicit user confirmation.
    
    ## Confirmation Workflow
    1) User requests removal ("Remove the React notebook")
    2) Look up full name to confirm
    3) Ask: "Remove '[notebook_name]' from your library? (Does not delete the actual NotebookLM notebook)"
    4) Only on explicit "Yes" → call remove_notebook
    
    Never remove without permission or based on assumptions.
    
    Example:
    User: "Delete the old React notebook"
    You: "Remove 'React Best Practices' from your library?"
    User: "Yes" → call remove_notebook`,
        inputSchema: {
          type: "object",
          properties: {
            id: {
              type: "string",
              description: "The notebook ID to remove",
            },
          },
          required: ["id"],
        },
      },
  • src/index.ts:216-220 (registration)
    Dispatch/registration in main tool call handler: routes 'remove_notebook' calls to handleRemoveNotebook with typed args.
    case "remove_notebook":
      result = await this.toolHandlers.handleRemoveNotebook(
        args as { id: string }
      );
      break;
  • Core library method: filters notebook from list, updates active_notebook_id if needed, persists to storage.
     */
    removeNotebook(id: string): boolean {
      const notebook = this.getNotebook(id);
      if (!notebook) {
        return false;
      }
    
      log.info(`🗑️  Removing notebook: ${id}`);
    
      const updated = { ...this.library };
      updated.notebooks = updated.notebooks.filter((n) => n.id !== id);
    
      // If we removed the active notebook, select another one
      if (updated.active_notebook_id === id) {
        updated.active_notebook_id =
          updated.notebooks.length > 0 ? updated.notebooks[0].id : null;
      }
    
      this.saveLibrary(updated);
      log.success(`✅ Notebook removed: ${id}`);
    
      return true;
    }
Behavior5/5

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

With no annotations provided, the description carries full burden and excels at behavioral disclosure. It explicitly warns 'Dangerous', specifies the confirmation workflow requirement, clarifies what gets removed (from library, not the actual notebook), and provides concrete implementation guidance. This goes well beyond basic functional description.

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

Conciseness3/5

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

The description is appropriately front-loaded with the critical warning, but includes extensive workflow details and a full example. While all content is valuable for this dangerous operation, the multi-part structure with numbered steps and example could be more streamlined. Every sentence earns its place for safety, but it's not maximally concise.

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

Completeness4/5

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

For a destructive tool with no annotations and no output schema, the description provides excellent contextual completeness. It covers the dangerous nature, required workflow, what actually gets removed, and concrete usage examples. The main gap is lack of information about return values or error conditions, but given the safety emphasis, this is reasonably complete.

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

Parameters3/5

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

Schema description coverage is 100% with the single parameter 'id' documented as 'The notebook ID to remove'. The description doesn't add any additional parameter semantics beyond what the schema provides, such as format examples or ID sourcing. With high schema coverage, baseline 3 is appropriate.

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

Purpose4/5

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

The description clearly states the tool removes a notebook from the user's library, with the specific verb 'remove' and resource 'notebook'. It distinguishes from siblings like 'delete' operations by clarifying it 'does not delete the actual NotebookLM notebook', though it doesn't explicitly differentiate from other removal-related tools (none exist in siblings).

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

Usage Guidelines5/5

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

The description provides explicit, step-by-step guidelines on when to use this tool: only after user confirmation in a specific workflow (steps 1-4). It clearly states 'Never remove without permission or based on assumptions', offering strong exclusion criteria. The example further illustrates proper usage context.

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/inventra/notebooklm-mcp'

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