Skip to main content
Glama

Skills MCP

by skills-mcp
validation.ts923 B
import type { ParsedSkillFile } from './schemas.js' import { parsedSkillFileSchema } from './schemas.js' export class ValidationError extends Error { constructor(message: string) { super(message) this.name = 'ValidationError' } } /** * Assert skill metadata from YAML frontmatter is valid */ export function assertParsedSkillFile( parsedSkillFile: any, skillFilePath: string, ): asserts parsedSkillFile is ParsedSkillFile { const validatedSkillFile = parsedSkillFileSchema.safeParse(parsedSkillFile) if (!validatedSkillFile.success) { throw new ValidationError( `Invalid skill file at ${skillFilePath}: ${validatedSkillFile.error.message}`, ) } } // Skill IDs should be lowercase with hyphens const validPattern = /^[a-z0-9]+(-[a-z0-9]+)*$/ /** * Validate skill directory name */ export function validateSkillId(skillId: string): boolean { return validPattern.test(skillId) }

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/skills-mcp/skills-mcp'

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