status
Check system status to monitor total documents, chunks, database size, and configuration details for your local document search setup.
Instructions
Get system status including total documents, total chunks, database size, and configuration information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/index.ts:424-442 (handler)The primary handler for the 'status' MCP tool. It calls vectorStore.getStatus() and returns the status as formatted JSON in the MCP content format./** * status tool handler (Phase 1: basic implementation) */ async handleStatus(): Promise<{ content: [{ type: 'text'; text: string }] }> { try { const status = await this.vectorStore.getStatus() return { content: [ { type: 'text', text: JSON.stringify(status, null, 2), }, ], } } catch (error) { console.error('Failed to get status:', error) throw error } }
- src/server/index.ts:200-204 (registration)Registration of the 'status' tool in the MCP ListToolsRequestHandler, defining name, description, and input schema (no parameters required).name: 'status', description: 'Get system status including total documents, total chunks, database size, and configuration information.', inputSchema: { type: 'object', properties: {} }, },
- src/server/index.ts:227-228 (registration)Dispatch to status handler in the MCP CallToolRequestHandler switch statement.case 'status': return await this.handleStatus()
- src/server/index.ts:203-203 (schema)Input schema for the 'status' tool: empty object (no input parameters).inputSchema: { type: 'object', properties: {} },
- src/vectordb/index.ts:289-333 (helper)Supporting getStatus() method in VectorStore class that provides the core status data: document/chunk counts, memory usage, and uptime./** * Get system status * * @returns System status information */ async getStatus(): Promise<{ documentCount: number chunkCount: number memoryUsage: number uptime: number }> { if (!this.table) { return { documentCount: 0, chunkCount: 0, memoryUsage: 0, uptime: process.uptime(), } } try { // Retrieve all records const allRecords = await this.table.query().toArray() const chunkCount = allRecords.length // Count unique file paths const uniqueFilePaths = new Set(allRecords.map((record) => record.filePath as string)) const documentCount = uniqueFilePaths.size // Get memory usage (in MB) const memoryUsage = process.memoryUsage().heapUsed / 1024 / 1024 // Get uptime (in seconds) const uptime = process.uptime() return { documentCount, chunkCount, memoryUsage, uptime, } } catch (error) { throw new DatabaseError('Failed to get status', error as Error) } }