Skip to main content
Glama

Hacker News MCP Server

validation.ts455 B
import { z } from "zod"; /** * Validate input against a Zod schema */ export function validateInput<T>(schema: z.ZodType<T>, input: unknown): T { try { return schema.parse(input); } catch (error) { if (error instanceof z.ZodError) { const issues = error.issues .map((issue) => `${issue.path.join(".")}: ${issue.message}`) .join(", "); throw new Error(`Validation error: ${issues}`); } throw 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/devabdultech/hn-mcp'

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