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
getObjectByFilePath.ts•861 B
import { readFile } from "fs/promises";
import { TrellisObject } from "../../models";
import { deserializeTrellisObject } from "../../utils/deserializeTrellisObject";
import { getChildrenByFilePath } from "./getChildrenByFilePath";
/**
* Gets a TrellisObject by reading and deserializing a specific markdown file
* @param filePath The full path to the markdown file to read
* @returns Promise resolving to the TrellisObject from the file
* @throws Error if file reading fails or deserialization fails
*/
export async function getObjectByFilePath(
filePath: string,
): Promise<TrellisObject> {
const fileContent = await readFile(filePath, "utf-8");
const trellisObject = deserializeTrellisObject(fileContent);
// Populate children using the file path
trellisObject.childrenIds = await getChildrenByFilePath(filePath);
return trellisObject;
}