Skip to main content
Glama
validateYamlWrapping.ts1.07 kB
import { ValidationContext } from '../types.js'; import { hasUnwrappedContent, wrapInYamlBlocks } from '../utils/markdownUtils.js'; /** * Validates that all content in LAML files is wrapped in ```yaml blocks * Auto-fixes for .md files, errors for .mdc files with unwrapped content */ export function validateYamlWrapping( context: ValidationContext, originalContent: string, filename: string ): string { const { session } = context; const isMdFile = filename.endsWith('.md'); const isMdcFile = filename.endsWith('.mdc'); // Only validate LAML files if (!filename.includes('.laml.')) { return originalContent; } const hasUnwrapped = hasUnwrappedContent(originalContent, filename); // Check if there's unwrapped content if (hasUnwrapped) { if (isMdFile || isMdcFile) { // Auto-fix for both .md and .mdc files const wrappedContent = wrapInYamlBlocks(originalContent, filename); context.autoFixManager.add('Wrapped content in ```yaml blocks'); return wrappedContent; } } return originalContent; }

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/EgorKluch/mcp-laml'

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