get_notebook
Retrieve detailed information about a specific notebook by ID to access its content and metadata for querying and analysis.
Instructions
Get detailed information about a specific notebook by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The notebook ID |
Implementation Reference
- src/tools/handlers.ts:622-649 (handler)The primary handler function that implements the core logic of the 'get_notebook' tool. It retrieves the notebook by ID from the library, handles errors if not found, and returns the notebook data or an error.async handleGetNotebook(args: { id: string }): Promise<ToolResult<{ notebook: any }>> { log.info(`🔧 [TOOL] get_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}`, }; } log.success(`✅ [TOOL] get_notebook completed: ${notebook.name}`); return { success: true, data: { notebook }, }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); log.error(`❌ [TOOL] get_notebook failed: ${errorMessage}`); return { success: false, error: errorMessage, }; } }
- The tool schema definition for 'get_notebook', specifying the input schema (requires 'id' string) and description used by the MCP protocol.{ name: "get_notebook", description: "Get detailed information about a specific notebook by ID", inputSchema: { type: "object", properties: { id: { type: "string", description: "The notebook ID", }, }, required: ["id"], }, },
- src/index.ts:189-193 (registration)The registration/dispatch logic in the main MCP server that maps incoming 'get_notebook' tool calls to the corresponding handler method.case "get_notebook": result = await this.toolHandlers.handleGetNotebook( args as { id: string } ); break;
- The underlying helper method in NotebookLibrary that performs the actual notebook lookup by ID, used by the tool handler.getNotebook(id: string): NotebookEntry | null { return this.library.notebooks.find((n) => n.id === id) || null; }