Skip to main content
Glama

Task Trellis MCP

validateParentExists.ts930 B
import type { Repository } from "../repositories/Repository.js"; import { ValidationError } from "./ValidationError.js"; import { ValidationErrorCodes } from "./ValidationErrorCodes.js"; /** * Validates that a parent object exists in the repository. * * @param parentId - The ID of the parent object to validate * @param repository - Repository instance to check for parent existence * @throws {ValidationError} When parent ID is provided but parent doesn't exist */ export async function validateParentExists( parentId: string | null, repository: Repository, ): Promise<void> { // If no parent is specified, validation passes if (!parentId) { return; } const parentObject = await repository.getObjectById(parentId); if (!parentObject) { throw new ValidationError( `Parent object with ID '${parentId}' does not exist`, ValidationErrorCodes.PARENT_NOT_FOUND, "parent", ); } }

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