Skip to main content
Glama
textFormatter.ts617 B
import type { ContentType, SocialPlatform } from "../textUtils.js"; export class TruncatedTextFormatter { /** * Format the result of text truncation for before-fold limits */ formatTruncatedText( truncatedText: string, platform: SocialPlatform, contentType: ContentType = "post", ): string { const platformName = platform.charAt(0).toUpperCase() + platform.slice(1); const contentTypeLabel = contentType !== "post" ? ` (${contentType})` : ""; return `**Truncated Text for ${platformName}${contentTypeLabel}:**\n\n${truncatedText}\n\n**Character Count:** ${truncatedText.length} characters`; } }

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/synthetic-ci/vibe-marketing'

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