Skip to main content
Glama
helpers.ts1.09 kB
import type { ToolResponse } from "../types"; /** * Logger utility for consistent logging across the application */ export const logger = { info: (message: string, ...args: any[]) => { console.log(`[INFO] ${message}`, ...args); }, error: (message: string, ...args: any[]) => { console.error(`[ERROR] ${message}`, ...args); }, debug: (message: string, ...args: any[]) => { console.debug(`[DEBUG] ${message}`, ...args); }, warn: (message: string, ...args: any[]) => { console.warn(`[WARN] ${message}`, ...args); }, }; /** * Ensure URL starts with https:// */ export function ensureHttpsPrefix(url: string): string { if (url.startsWith("https://") || url.startsWith("http://")) { return url; } return `https://${url}`; } /** * Create success response */ export function createSuccessResponse(message: string): ToolResponse { return { content: [{ type: "text", text: message }], }; } /** * Create error response */ export function createErrorResponse(error: Error): ToolResponse { return { content: [{ type: "text", text: `Error: ${error.message}` }], }; }

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/AIGC-Hackers/mcp-server'

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