Skip to main content
Glama
by LeGenAI
advanced-test.js•2.53 kB
// Polyfill fetch for Node.js import fetch from 'node-fetch'; // @ts-ignore global.fetch = fetch; import { SupabaseMagmaKnowledgeBase } from './dist/supabase-knowledge-base.js'; import { config } from 'dotenv'; config(); async function advancedTest() { console.log('šŸ”¬ Advanced MAGMA Query Testing...\n'); try { const kb = new SupabaseMagmaKnowledgeBase(); await kb.initialize(); // Test 1: Complex mathematical concepts console.log('šŸ“ Testing: Galois Theory'); const galoisResults = await kb.search('Galois group polynomial field extension', 5); console.log(`Found ${galoisResults.length} results:`); galoisResults.forEach((result, i) => { console.log(` ${i+1}. [${result.score.toFixed(3)}] ${result.content.substring(0, 80)}...`); }); console.log('\nšŸ“Š Testing: Group Theory'); const groupResults = await kb.search('permutation group symmetric alternating', 5); console.log(`Found ${groupResults.length} results:`); groupResults.forEach((result, i) => { console.log(` ${i+1}. [${result.score.toFixed(3)}] ${result.content.substring(0, 80)}...`); }); console.log('\nšŸ”¢ Testing: Number Theory'); const numberResults = await kb.search('prime factorization quadratic residue', 5); console.log(`Found ${numberResults.length} results:`); numberResults.forEach((result, i) => { console.log(` ${i+1}. [${result.score.toFixed(3)}] ${result.content.substring(0, 80)}...`); }); // Test 2: Specific MAGMA functions console.log('\n🧮 Testing: MAGMA Functions'); const functions = ['IsIrreducible', 'FactorInteger', 'EllipticCurve', 'PermutationGroup']; for (const func of functions) { const results = await kb.search(func, 2, 'function'); console.log(`${func}: ${results.length} results found`); } // Test 3: Code complexity analysis console.log('\nāš™ļø Testing: Code Analysis'); const complexCode = ` K := GF(101); E := EllipticCurve([K | 1, 2]); P := RandomPoint(E); for i in [1..10] do Q := i * P; if IsZero(Q) then print "Order divides", i; end if; end for; `; const explanation = await kb.explainCode(complexCode); console.log('Complex code explanation generated:', explanation.length > 100 ? 'āœ…' : 'āŒ'); console.log('\nšŸŽÆ Advanced testing completed successfully!'); } catch (error) { console.error('āŒ Advanced test failed:', error); } } advancedTest();

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/LeGenAI/mcp-magma-handbook'

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