Skip to main content
Glama
utils.ts583 B
import { readFileSync } from "fs"; import { dirname, join } from "path"; import { fileURLToPath } from "url"; export const getVersion = (): string => { try { const packageJsonPath = join( dirname(fileURLToPath(import.meta.url)), "..", "package.json", ); const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")); return packageJson.version; } catch (error) { console.error("Failed to read package version:", error); return "unknown"; } }; export const createToolResponse = (text: string) => ({ content: [{ type: "text" as const, text }], });

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/railwayapp/railway-mcp-server'

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