Skip to main content
Glama
Environment.ts•1.47 kB
/** * 🎯 SEMANTIC INTENT: Environment represents deployment context * * WHY: Environment is a semantic anchor that preserves database selection intent * - "development" semantically means: testing, experimentation, safe to modify * - "staging" semantically means: pre-production validation, production-like * - "production" semantically means: live data, critical operations, read-carefully * * IMMUTABILITY: Value objects are immutable by design * OBSERVABLE: Environment is directly observable from configuration/context */ export enum Environment { DEVELOPMENT = 'development', STAGING = 'staging', PRODUCTION = 'production', } /** * Parse string to Environment enum * * @throws Error if value is not a valid environment */ export function parseEnvironment(value: string): Environment { const normalized = value.toLowerCase(); if (normalized === 'development' || normalized === 'dev') { return Environment.DEVELOPMENT; } if (normalized === 'staging' || normalized === 'stage') { return Environment.STAGING; } if (normalized === 'production' || normalized === 'prod') { return Environment.PRODUCTION; } throw new Error( `Invalid environment: "${value}". Must be one of: development, staging, production` ); } /** * Check if value is a valid environment */ export function isValidEnvironment(value: string): boolean { try { parseEnvironment(value); return true; } catch { return false; } }

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/semanticintent/semantic-d1-mcp'

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