Skip to main content
Glama

Task Trellis MCP

serializeTrellisObject.ts1.27 kB
import { stringify } from "yaml"; import { TrellisObject } from "../models"; /** * Serializes a TrellisObject to a markdown string with YAML frontmatter * @param trellisObject - The TrellisObject to serialize * @returns A markdown string with YAML frontmatter */ export function serializeTrellisObject(trellisObject: TrellisObject): string { // Convert Map to plain object for YAML serialization const affectedFilesObj = Object.fromEntries(trellisObject.affectedFiles); // Create the frontmatter object (excluding body since it goes in the markdown content) const frontmatter = { id: trellisObject.id, title: trellisObject.title, status: trellisObject.status, priority: trellisObject.priority, parent: trellisObject.parent ?? "none", prerequisites: trellisObject.prerequisites, affectedFiles: affectedFilesObj, log: trellisObject.log, schema: trellisObject.schema, childrenIds: trellisObject.childrenIds, created: trellisObject.created, updated: trellisObject.updated, }; // Generate YAML frontmatter const yamlFrontmatter = stringify(frontmatter).trim(); // Combine YAML frontmatter with markdown body const markdown = `--- ${yamlFrontmatter} --- ${trellisObject.body}`; return markdown; }

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/langadventurellc/task-trellis-mcp'

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