Skip to main content
Glama
christophersutton

InstantDB MCP Server

queries.ts1.02 kB
export interface Query { id: string; name: string; timestamp: string; query: string; result?: any; success?: boolean; error?: string; } class QueryStore { private queries: Map<string, Query> = new Map(); addQuery(name: string, query: string, result: any = null, success: boolean = true, error: string = ''): Query { const timestamp = new Date().toISOString(); // Create id using the provided name and the current timestamp (numeric for uniqueness) const safeName = name.replace(/\s+/g, '_'); const id = `${safeName}-${Date.now()}`; const newQuery: Query = { id, name, timestamp, query, result, success, error }; this.queries.set(id, newQuery); return newQuery; } listQueries(limit: number = 10): Query[] { return Array.from(this.queries.values()) .sort((a, b) => b.timestamp.localeCompare(a.timestamp)) .slice(0, limit); } getQuery(id: string): Query | undefined { return this.queries.get(id); } } export const queryStore = new QueryStore();

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/christophersutton/instantdb-mcp'

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