Skip to main content
Glama
IBM
by IBM
constructEndpointUrl.ts532 B
export const constructEndpointUrl = ( value: string | null | undefined ): string => { if (!value) return '' if (value.startsWith('http://') || value.startsWith('https://')) { return decodeURIComponent(value) } // Check if the endpoint is localhost or an IP address if ( value.startsWith('localhost') || /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.test(value) ) { return `http://${decodeURIComponent(value)}` } // For all other cases, default to HTTPS return `https://${decodeURIComponent(value)}` }

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/IBM/ibmi-mcp'

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