Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

676 B
Raw Blame
/** Extract a human-readable message from an unknown thrown value. */
export function errMsg(cause: unknown): string {
  return cause instanceof Error ? cause.message : String(cause);
}

type McpTextResult = {
  content: Array<{ type: "text"; text: string }>;
  isError?: boolean;
};

/** Standard MCP error result for a caught exception. */
export function mcpError(cause: unknown): McpTextResult {
  return {
    content: [{ type: "text", text: `Error: ${errMsg(cause)}` }],
    isError: true,
  };
}

/** Standard MCP success result wrapping a single text payload. */
export function mcpText(text: string): McpTextResult {
  return { content: [{ type: "text", text }] };
}