Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 } }
  • 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: {} }, },
  • Dispatch to status handler in the MCP CallToolRequestHandler switch statement.
    case 'status': return await this.handleStatus()
  • Input schema for the 'status' tool: empty object (no input parameters).
    inputSchema: { type: 'object', properties: {} },
  • 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) } }

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