search_notebooks
Find relevant notebooks in your library by searching names, descriptions, topics, and tags to identify useful resources for your task.
Instructions
Search library by query (name, description, topics, tags). Use to propose relevant notebooks for the task and then ask which to use.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query |
Implementation Reference
- src/tools/handlers.ts:744-765 (handler)The primary handler function for the 'search_notebooks' tool. It logs the call, searches the notebook library using the provided query, returns the matching notebooks on success, or an error message on failure.* Handle search_notebooks tool */ async handleSearchNotebooks(args: { query: string }): Promise<ToolResult<{ notebooks: any[] }>> { log.info(`🔧 [TOOL] search_notebooks called`); log.info(` Query: "${args.query}"`); try { const notebooks = this.library.searchNotebooks(args.query); log.success(`✅ [TOOL] search_notebooks completed (${notebooks.length} results)`); return { success: true, data: { notebooks }, }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); log.error(`❌ [TOOL] search_notebooks failed: ${errorMessage}`); return { success: false, error: errorMessage, }; } }
- The tool definition including name, description, and input schema (requires 'query' string) for 'search_notebooks'.{ name: "search_notebooks", description: "Search library by query (name, description, topics, tags). " + "Use to propose relevant notebooks for the task and then ask which to use.", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query", }, }, required: ["query"], }, },
- src/index.ts:222-226 (registration)MCP server dispatches 'search_notebooks' tool calls to the ToolHandlers.handleSearchNotebooks method.case "search_notebooks": result = await this.toolHandlers.handleSearchNotebooks( args as { query: string } ); break;
- Core search logic in NotebookLibrary that filters notebooks matching the query in name, description, topics, or tags.searchNotebooks(query: string): NotebookEntry[] { const lowerQuery = query.toLowerCase(); return this.library.notebooks.filter( (n) => n.name.toLowerCase().includes(lowerQuery) || n.description.toLowerCase().includes(lowerQuery) || n.topics.some((t) => t.toLowerCase().includes(lowerQuery)) || n.tags?.some((t) => t.toLowerCase().includes(lowerQuery)) ); }