Skip to main content
Glama
ko.ts•4.71 kB
import type { $ZodStringFormats } from "../core/checks.js"; import type * as errors from "../core/errors.js"; import * as util from "../core/util.js"; const error: () => errors.$ZodErrorMap = () => { const Sizable: Record<string, { unit: string; verb: string }> = { string: { unit: "ė¬øģž", verb: "to have" }, file: { unit: "ė°”ģ“ķŠø", verb: "to have" }, array: { unit: "개", verb: "to have" }, set: { unit: "개", verb: "to have" }, }; function getSizing(origin: string): { unit: string; verb: string } | null { return Sizable[origin] ?? null; } const parsedType = (data: any): string => { const t = typeof data; switch (t) { case "number": { return Number.isNaN(data) ? "NaN" : "number"; } case "object": { if (Array.isArray(data)) { return "array"; } if (data === null) { return "null"; } if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) { return data.constructor.name; } } } return t; }; const Nouns: { [k in $ZodStringFormats | (string & {})]?: string; } = { regex: "ģž…ė „", email: "ģ“ė©”ģ¼ ģ£¼ģ†Œ", url: "URL", emoji: "ģ“ėŖØģ§€", uuid: "UUID", uuidv4: "UUIDv4", uuidv6: "UUIDv6", nanoid: "nanoid", guid: "GUID", cuid: "cuid", cuid2: "cuid2", ulid: "ULID", xid: "XID", ksuid: "KSUID", datetime: "ISO ė‚ ģ§œģ‹œź°„", date: "ISO ė‚ ģ§œ", time: "ISO ģ‹œź°„", duration: "ISO źø°ź°„", ipv4: "IPv4 ģ£¼ģ†Œ", ipv6: "IPv6 ģ£¼ģ†Œ", cidrv4: "IPv4 ė²”ģœ„", cidrv6: "IPv6 ė²”ģœ„", base64: "base64 ģøģ½”ė”© ė¬øģžģ—“", base64url: "base64url ģøģ½”ė”© ė¬øģžģ—“", json_string: "JSON ė¬øģžģ—“", e164: "E.164 번호", jwt: "JWT", template_literal: "ģž…ė „", }; return (issue) => { switch (issue.code) { case "invalid_type": return `ģž˜ėŖ»ėœ ģž…ė „: 예상 ķƒ€ģž…ģ€ ${issue.expected}, ė°›ģ€ ķƒ€ģž…ģ€ ${parsedType(issue.input)}ģž…ė‹ˆė‹¤`; case "invalid_value": if (issue.values.length === 1) return `ģž˜ėŖ»ėœ ģž…ė „: ź°’ģ€ ${util.stringifyPrimitive(issue.values[0])} ģ“ģ–“ģ•¼ ķ•©ė‹ˆė‹¤`; return `ģž˜ėŖ»ėœ ģ˜µģ…˜: ${util.joinValues(issue.values, "ė˜ėŠ” ")} 중 ķ•˜ė‚˜ģ—¬ģ•¼ ķ•©ė‹ˆė‹¤`; case "too_big": { const adj = issue.inclusive ? "ģ“ķ•˜" : "미만"; const suffix = adj === "미만" ? "ģ“ģ–“ģ•¼ ķ•©ė‹ˆė‹¤" : "여야 ķ•©ė‹ˆė‹¤"; const sizing = getSizing(issue.origin); const unit = sizing?.unit ?? "ģš”ģ†Œ"; if (sizing) return `${issue.origin ?? "ź°’"}ģ“ ė„ˆė¬“ ķ½ė‹ˆė‹¤: ${issue.maximum.toString()}${unit} ${adj}${suffix}`; return `${issue.origin ?? "ź°’"}ģ“ ė„ˆė¬“ ķ½ė‹ˆė‹¤: ${issue.maximum.toString()} ${adj}${suffix}`; } case "too_small": { const adj = issue.inclusive ? "ģ“ģƒ" : "쓈과"; const suffix = adj === "ģ“ģƒ" ? "ģ“ģ–“ģ•¼ ķ•©ė‹ˆė‹¤" : "여야 ķ•©ė‹ˆė‹¤"; const sizing = getSizing(issue.origin); const unit = sizing?.unit ?? "ģš”ģ†Œ"; if (sizing) { return `${issue.origin ?? "ź°’"}ģ“ ė„ˆė¬“ ģž‘ģŠµė‹ˆė‹¤: ${issue.minimum.toString()}${unit} ${adj}${suffix}`; } return `${issue.origin ?? "ź°’"}ģ“ ė„ˆė¬“ ģž‘ģŠµė‹ˆė‹¤: ${issue.minimum.toString()} ${adj}${suffix}`; } case "invalid_format": { const _issue = issue as errors.$ZodStringFormatIssues; if (_issue.format === "starts_with") { return `ģž˜ėŖ»ėœ ė¬øģžģ—“: "${_issue.prefix}"(으)딜 ģ‹œģž‘ķ•“ģ•¼ ķ•©ė‹ˆė‹¤`; } if (_issue.format === "ends_with") return `ģž˜ėŖ»ėœ ė¬øģžģ—“: "${_issue.suffix}"(으)딜 ėė‚˜ģ•¼ ķ•©ė‹ˆė‹¤`; if (_issue.format === "includes") return `ģž˜ėŖ»ėœ ė¬øģžģ—“: "${_issue.includes}"ģ„(넼) ķ¬ķ•Øķ•“ģ•¼ ķ•©ė‹ˆė‹¤`; if (_issue.format === "regex") return `ģž˜ėŖ»ėœ ė¬øģžģ—“: ģ •ź·œģ‹ ${_issue.pattern} ķŒØķ„“ź³¼ ģ¼ģ¹˜ķ•“ģ•¼ ķ•©ė‹ˆė‹¤`; return `ģž˜ėŖ»ėœ ${Nouns[_issue.format] ?? issue.format}`; } case "not_multiple_of": return `ģž˜ėŖ»ėœ ģˆ«ģž: ${issue.divisor}ģ˜ ė°°ģˆ˜ģ—¬ģ•¼ ķ•©ė‹ˆė‹¤`; case "unrecognized_keys": return `ģøģ‹ķ•  수 ģ—†ėŠ” 키: ${util.joinValues(issue.keys, ", ")}`; case "invalid_key": return `ģž˜ėŖ»ėœ 키: ${issue.origin}`; case "invalid_union": return `ģž˜ėŖ»ėœ ģž…ė „`; case "invalid_element": return `ģž˜ėŖ»ėœ ź°’: ${issue.origin}`; default: return `ģž˜ėŖ»ėœ ģž…ė „`; } }; }; export default function (): { localeError: errors.$ZodErrorMap } { return { localeError: error(), }; }

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/airmcp-com/mcp-standards'

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