A React Native app for the ultimate thinking partner.
at main 1.9 kB view raw
1const { LettaClient } = require('@letta-ai/letta-client'); 2const token = process.env.LETTA_API_KEY; 3 4if (!token) { 5 console.error('Please set LETTA_API_KEY environment variable'); 6 process.exit(1); 7} 8 9const client = new LettaClient({ token }); 10 11(async () => { 12 try { 13 console.log('=== LISTING ALL AVAILABLE TOOLS ===\n'); 14 const allTools = await client.tools.list(); 15 16 console.log(`Found ${allTools.length} tools total\n`); 17 18 // Group tools by type 19 const toolsByType = {}; 20 allTools.forEach(tool => { 21 const type = tool.toolType || 'unknown'; 22 if (!toolsByType[type]) { 23 toolsByType[type] = []; 24 } 25 toolsByType[type].push(tool); 26 }); 27 28 // Display tools grouped by type 29 Object.keys(toolsByType).sort().forEach(type => { 30 console.log(`\n=== ${type.toUpperCase()} ===`); 31 toolsByType[type].forEach(tool => { 32 console.log(` - ${tool.name} (${tool.id})`); 33 }); 34 }); 35 36 // Search for archival tools specifically 37 console.log('\n\n=== SEARCHING FOR ARCHIVAL TOOLS ==='); 38 const archivalTools = allTools.filter(t => t.name?.includes('archival')); 39 if (archivalTools.length > 0) { 40 archivalTools.forEach(tool => { 41 console.log(`${tool.name} (${tool.id})`); 42 }); 43 } else { 44 console.log(' ✗ No archival tools found'); 45 } 46 47 // Search for memory tools 48 console.log('\n=== SEARCHING FOR MEMORY TOOLS ==='); 49 const memoryTools = allTools.filter(t => t.name?.includes('memory')); 50 if (memoryTools.length > 0) { 51 memoryTools.forEach(tool => { 52 console.log(` - ${tool.name} (${tool.id}) [${tool.toolType}]`); 53 }); 54 } else { 55 console.log(' ✗ No memory tools found'); 56 } 57 58 } catch (e) { 59 console.error('Error:', e.message); 60 if (e.body) { 61 console.error('Error body:', JSON.stringify(e.body, null, 2)); 62 } 63 } 64})();