Skip to main content
Glama
aegntic

Obsidian Elite RAG MCP Server

node-repository.ts2.65 kB
import { DatabaseAdapter } from './database-adapter'; import { ParsedNode } from '../parsers/node-parser'; export class NodeRepository { constructor(private db: DatabaseAdapter) {} /** * Save node with proper JSON serialization */ saveNode(node: ParsedNode): void { const stmt = this.db.prepare(` INSERT OR REPLACE INTO nodes ( node_type, package_name, display_name, description, category, development_style, is_ai_tool, is_trigger, is_webhook, is_versioned, version, documentation, properties_schema, operations, credentials_required ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) `); stmt.run( node.nodeType, node.packageName, node.displayName, node.description, node.category, node.style, node.isAITool ? 1 : 0, node.isTrigger ? 1 : 0, node.isWebhook ? 1 : 0, node.isVersioned ? 1 : 0, node.version, node.documentation || null, JSON.stringify(node.properties, null, 2), JSON.stringify(node.operations, null, 2), JSON.stringify(node.credentials, null, 2) ); } /** * Get node with proper JSON deserialization */ getNode(nodeType: string): any { const row = this.db.prepare(` SELECT * FROM nodes WHERE node_type = ? `).get(nodeType) as any; if (!row) return null; return { nodeType: row.node_type, displayName: row.display_name, description: row.description, category: row.category, developmentStyle: row.development_style, package: row.package_name, isAITool: !!row.is_ai_tool, isTrigger: !!row.is_trigger, isWebhook: !!row.is_webhook, isVersioned: !!row.is_versioned, version: row.version, properties: this.safeJsonParse(row.properties_schema, []), operations: this.safeJsonParse(row.operations, []), credentials: this.safeJsonParse(row.credentials_required, []), hasDocumentation: !!row.documentation }; } /** * Get AI tools with proper filtering */ getAITools(): any[] { const rows = this.db.prepare(` SELECT node_type, display_name, description, package_name FROM nodes WHERE is_ai_tool = 1 ORDER BY display_name `).all() as any[]; return rows.map(row => ({ nodeType: row.node_type, displayName: row.display_name, description: row.description, package: row.package_name })); } private safeJsonParse(json: string, defaultValue: any): any { try { return JSON.parse(json); } catch { return defaultValue; } } }

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/aegntic/aegntic-MCP'

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