Skip to main content
Glama

status

Check system health and configuration for a local document search tool that processes PDF, DOCX, TXT, and Markdown files on your machine.

Instructions

Get system status including total documents, total chunks, database size, and configuration information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'status' MCP tool in the ListTools response, defining name, description, and empty input schema.
    { name: 'status', description: 'Get system status including total documents, total chunks, database size, and configuration information.', inputSchema: { type: 'object', properties: {} }, },
  • Primary handler function for the 'status' tool. Fetches status data from VectorStore and formats it as JSON text content for MCP response.
    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 } }
  • Supporting VectorStore.getStatus() method that computes detailed system metrics including document/chunk counts, memory usage, uptime, FTS status, and search mode.
    async getStatus(): Promise<{ documentCount: number chunkCount: number memoryUsage: number uptime: number ftsIndexEnabled: boolean searchMode: 'hybrid' | 'vector-only' }> { if (!this.table) { return { documentCount: 0, chunkCount: 0, memoryUsage: 0, uptime: process.uptime(), ftsIndexEnabled: false, searchMode: 'vector-only', } } 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, ftsIndexEnabled: this.ftsEnabled, searchMode: this.ftsEnabled && (this.config.hybridWeight ?? 0.6) > 0 ? 'hybrid' : 'vector-only', } } catch (error) { throw new DatabaseError('Failed to get status', error as Error) } }
  • Tool dispatching switch statement in CallToolRequestSchema handler that routes 'status' calls to handleStatus().
    async (request: { params: { name: string; arguments?: unknown } }) => { switch (request.params.name) { case 'query_documents': return await this.handleQueryDocuments( request.params.arguments as unknown as QueryDocumentsInput ) case 'ingest_file': return await this.handleIngestFile( request.params.arguments as unknown as IngestFileInput ) case 'ingest_data': return await this.handleIngestData( request.params.arguments as unknown as IngestDataInput ) case 'delete_file': return await this.handleDeleteFile( request.params.arguments as unknown as DeleteFileInput ) case 'list_files': return await this.handleListFiles() case 'status': return await this.handleStatus() default: throw new Error(`Unknown tool: ${request.params.name}`) } }

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/shinpr/mcp-local-rag'

If you have feedback or need assistance with the MCP directory API, please join our Discord server