Skip to main content
Glama

update_notebook

Modify notebook metadata including topics, description, tags, and use cases to keep content organized and current.

Instructions

Update notebook metadata based on user intent.

Pattern

  1. Identify target notebook and fields (topics, description, use_cases, tags, url)

  2. Propose the exact change back to the user

  3. After explicit confirmation, call this tool

Examples

  • User: "React notebook also covers Next.js 14" You: "Add 'Next.js 14' to topics for React?" User: "Yes" → call update_notebook

  • User: "Include error handling in n8n description" You: "Update the n8n description to mention error handling?" User: "Yes" → call update_notebook

Tip: You may update multiple fields at once if requested.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe notebook ID to update
nameNoNew display name
descriptionNoNew description
topicsNoNew topics list
content_typesNoNew content types
use_casesNoNew use cases
tagsNoNew tags
urlNoNew notebook URL

Implementation Reference

  • Main MCP tool handler: receives args, delegates to library.updateNotebook, handles errors and logging.
     * Handle update_notebook tool
     */
    async handleUpdateNotebook(args: UpdateNotebookInput): Promise<ToolResult<{ notebook: any }>> {
      log.info(`🔧 [TOOL] update_notebook called`);
      log.info(`  ID: ${args.id}`);
    
      try {
        const notebook = this.library.updateNotebook(args);
        log.success(`✅ [TOOL] update_notebook completed: ${notebook.name}`);
        return {
          success: true,
          data: { notebook },
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        log.error(`❌ [TOOL] update_notebook failed: ${errorMessage}`);
        return {
          success: false,
          error: errorMessage,
        };
      }
    }
  • Core library function that performs the actual notebook update by merging new fields into the library data and persisting it.
    updateNotebook(input: UpdateNotebookInput): NotebookEntry {
      const notebook = this.getNotebook(input.id);
      if (!notebook) {
        throw new Error(`Notebook not found: ${input.id}`);
      }
    
      log.info(`📝 Updating notebook: ${input.id}`);
    
      const updated = { ...this.library };
      const index = updated.notebooks.findIndex((n) => n.id === input.id);
    
      updated.notebooks[index] = {
        ...notebook,
        ...(input.name && { name: input.name }),
        ...(input.description && { description: input.description }),
        ...(input.topics && { topics: input.topics }),
        ...(input.content_types && { content_types: input.content_types }),
        ...(input.use_cases && { use_cases: input.use_cases }),
        ...(input.tags && { tags: input.tags }),
        ...(input.url && { url: input.url }),
      };
    
      this.saveLibrary(updated);
      log.success(`✅ Notebook updated: ${input.id}`);
    
      return updated.notebooks[index];
    }
  • TypeScript interface defining the input parameters for updating a notebook.
    export interface UpdateNotebookInput {
      id: string; // Required: which notebook to update
      name?: string;
      description?: string;
      topics?: string[];
      content_types?: string[];
      use_cases?: string[];
      tags?: string[];
      url?: string; // Allow changing URL
    }
  • MCP tool definition including name, description, and JSON input schema for registration.
        name: "update_notebook",
        description:
          `Update notebook metadata based on user intent.
    
    ## Pattern
    1) Identify target notebook and fields (topics, description, use_cases, tags, url)
    2) Propose the exact change back to the user
    3) After explicit confirmation, call this tool
    
    ## Examples
    - User: "React notebook also covers Next.js 14"
      You: "Add 'Next.js 14' to topics for React?"
      User: "Yes" → call update_notebook
    
    - User: "Include error handling in n8n description"
      You: "Update the n8n description to mention error handling?"
      User: "Yes" → call update_notebook
    
    Tip: You may update multiple fields at once if requested.`,
        inputSchema: {
          type: "object",
          properties: {
            id: {
              type: "string",
              description: "The notebook ID to update",
            },
            name: {
              type: "string",
              description: "New display name",
            },
            description: {
              type: "string",
              description: "New description",
            },
            topics: {
              type: "array",
              items: { type: "string" },
              description: "New topics list",
            },
            content_types: {
              type: "array",
              items: { type: "string" },
              description: "New content types",
            },
            use_cases: {
              type: "array",
              items: { type: "string" },
              description: "New use cases",
            },
            tags: {
              type: "array",
              items: { type: "string" },
              description: "New tags",
            },
            url: {
              type: "string",
              description: "New notebook URL",
            },
          },
          required: ["id"],
        },
      },
  • src/index.ts:201-214 (registration)
    Dispatch routing in main server that maps tool name to handler call.
    case "update_notebook":
      result = await this.toolHandlers.handleUpdateNotebook(
        args as {
          id: string;
          name?: string;
          description?: string;
          topics?: string[];
          content_types?: string[];
          use_cases?: string[];
          tags?: string[];
          url?: string;
        }
      );
      break;
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's interactive workflow (propose-confirm-execute), which is crucial behavioral context not inferable from the schema. However, it doesn't mention potential side effects like overwriting existing data or permission requirements.

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

Conciseness4/5

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

The description is well-structured with clear sections (pattern, examples, tip) and front-loads the core purpose. Every sentence serves a purpose, though the pattern section could be slightly more concise by integrating the examples more tightly.

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 mutation tool with no annotations and no output schema, the description provides strong contextual completeness through the interactive workflow pattern and examples. It covers the 'how' and 'when' effectively, though it could benefit from mentioning what happens on success/failure or error handling.

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%, so the schema already documents all 8 parameters thoroughly. The description lists the fields (topics, description, use_cases, tags, url) in the pattern section, but this adds minimal value beyond what's in the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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?

The description clearly states the tool's purpose as updating notebook metadata based on user intent, specifying the verb 'update' and resource 'notebook metadata'. It distinguishes from siblings like 'add_notebook' (creation) and 'remove_notebook' (deletion) by focusing on modification of existing notebooks.

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 usage guidelines through a step-by-step pattern: identify target notebook and fields, propose changes to user, and call tool only after explicit confirmation. It includes examples illustrating when to use the tool and mentions that multiple fields can be updated at once if requested.

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