Skip to main content
Glama
test-save-api-fix.js1.92 kB
#!/usr/bin/env node /** * Test the save_composition_api fix */ import { createCompositionAPISaver } from './src/tools/save-composition-api.js'; console.log('🧪 Testing Save API Fix'); console.log('====================='); const saver = createCompositionAPISaver(); // Test the fixed metadata handling const testComposition = { version: "1.1", metadata: { title: "Máquinas Simples: Os Superpoderes da Física", description: "Aula completa sobre Máquinas Simples", thumb: null, tags: [] }, interface: { content_language: "pt_br", index_option: "buttons", font_family: "Lato", show_summary: "disabled", finish_btn: "disabled" }, structure: [ { id: "test-id-123", type: "head-1", category: "CIÊNCIAS", dam_assets: [] } ] }; try { console.log('📝 Testing metadata access...'); // Test the specific line that was failing const timestamp = Date.now(); const safeName = (testComposition.metadata.title || 'lesson').replace(/[^a-zA-Z0-9]/g, '_'); const fileName = `composition_${timestamp}_${safeName}.rdpcomposer`; console.log('✅ Metadata access successful!'); console.log(' - Title:', testComposition.metadata.title); console.log(' - Safe name:', safeName); console.log(' - Generated filename:', fileName); console.log('\n🔍 Fixed metadata structure test:'); console.log(' - version:', testComposition.version); console.log(' - metadata.title:', testComposition.metadata.title); console.log(' - interface.content_language:', testComposition.interface.content_language); console.log(' - structure.length:', testComposition.structure.length); console.log('\n✅ Save API fix verified - no more "cannot read properties" error!'); } catch (error) { console.log('❌ Test failed:', error.message); console.log('Stack:', error.stack); } console.log('\n🔍 Test complete');

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/rkm097git/euconquisto-composer-mcp-poc'

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