Skip to main content
Glama

get_library_stats

Retrieve statistics about your notebook library, including total notebooks and usage data, to monitor document collection activity.

Instructions

Get statistics about your notebook library (total notebooks, usage, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the get_library_stats tool. It calls this.library.getStats() to retrieve library statistics and returns them wrapped in ToolResult format, with proper logging and error handling.
    /** * Handle get_library_stats tool */ async handleGetLibraryStats(): Promise<ToolResult<any>> { log.info(`🔧 [TOOL] get_library_stats called`); try { const stats = this.library.getStats(); log.success(`✅ [TOOL] get_library_stats completed`); return { success: true, data: stats, }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); log.error(`❌ [TOOL] get_library_stats failed: ${errorMessage}`); return { success: false, error: errorMessage, }; } }
  • The tool schema definition, specifying the name, description, and empty input schema (no parameters required).
    { name: "get_library_stats", description: "Get statistics about your notebook library (total notebooks, usage, etc.)", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:228-230 (registration)
    The switch case in the main tool call handler that dispatches calls to the specific handleGetLibraryStats method.
    case "get_library_stats": result = await this.toolHandlers.handleGetLibraryStats(); break;
  • The supporting getStats method in NotebookLibrary class that computes and returns library statistics: total notebooks, active notebook, most used, total queries, last modified.
    getStats(): LibraryStats { const totalQueries = this.library.notebooks.reduce( (sum, n) => sum + n.use_count, 0 ); const mostUsed = this.library.notebooks.reduce((max, n) => n.use_count > (max?.use_count || 0) ? n : max , null as NotebookEntry | null); return { total_notebooks: this.library.notebooks.length, active_notebook: this.library.active_notebook_id, most_used_notebook: mostUsed?.id || null, total_queries: totalQueries, last_modified: this.library.last_modified, }; }

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