Skip to main content
Glama
config.ts1.03 kB
import { z } from 'zod'; import { existsSync } from 'fs'; import { join } from 'path'; const ConfigSchema = z.object({ WOTB_GAME_PATH: z.string().min(1, 'WOTB_GAME_PATH environment variable is required'), }); export function loadConfig() { const result = ConfigSchema.safeParse(process.env); if (!result.success) { throw new Error(`Configuration error: ${result.error.issues.map(i => i.message).join(', ')}`); } const gamePath = result.data.WOTB_GAME_PATH; const vehiclesPath = join(gamePath, 'XML', 'item_defs', 'vehicles'); if (!existsSync(vehiclesPath)) { throw new Error(`Invalid game path: ${vehiclesPath} does not exist`); } return { gamePath, paths: { vehicles: vehiclesPath, common: join(vehiclesPath, 'common'), strings: join(gamePath, 'Strings'), maps: join(gamePath, 'maps.yaml'), maps3d: join(gamePath, '3d', 'Maps'), camouflages: join(vehiclesPath, 'common', 'camouflages.xml'), }, }; } export type Config = ReturnType<typeof loadConfig>;

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/Revenant30102000/wotblitz-mcp'

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