Skip to main content
Glama
jakedx6
by jakedx6
debug.js1.98 kB
import { logger } from '../lib/logger.js'; /** * Debug tool to check environment and configuration */ export const debugEnvironmentTool = { name: 'debug_environment', description: 'Debug tool to check MCP server environment and configuration', inputSchema: { type: 'object', properties: {} } }; export const debugEnvironment = async (args) => { logger.info('Debug environment called'); const envInfo = { HELIOS_API_URL: process.env.HELIOS_API_URL || 'NOT SET', HELIOS_API_KEY_PREFIX: process.env.HELIOS_API_KEY ? process.env.HELIOS_API_KEY.substring(0, 20) + '...' : 'NOT SET', HELIOS_API_KEY_LENGTH: process.env.HELIOS_API_KEY?.length || 0, NODE_ENV: process.env.NODE_ENV || 'NOT SET', CWD: process.cwd(), NODE_VERSION: process.version, }; // Try a direct API call let apiTestResult = 'Not tested'; if (process.env.HELIOS_API_URL && process.env.HELIOS_API_KEY) { try { const response = await fetch(`${process.env.HELIOS_API_URL}/api/mcp/projects?limit=1`, { headers: { 'Authorization': `Bearer ${process.env.HELIOS_API_KEY}`, 'Content-Type': 'application/json' } }); apiTestResult = `${response.status} ${response.statusText}`; if (response.ok) { const data = await response.json(); apiTestResult += ` - ${data.projects?.length || 0} projects found`; } } catch (error) { apiTestResult = `Error: ${error instanceof Error ? error.message : String(error)}`; } } return { environment: envInfo, apiTest: apiTestResult, timestamp: new Date().toISOString() }; }; // Export tools and handlers export const debugTools = { debugEnvironmentTool }; export const debugHandlers = { debug_environment: debugEnvironment };

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/jakedx6/helios9-MCP-Server'

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