Skip to main content
Glama

mcp-server-circleci

Official
outputTextTruncated.ts969 B
import { McpSuccessResponse } from './mcpResponse.js'; const MAX_LENGTH = 50000; export const SEPARATOR = '\n<<<SEPARATOR>>>\n'; /** * Creates an MCP response with potentially truncated text * @param outputText The full text that might need to be truncated * @returns An MCP response containing the original or truncated text */ const outputTextTruncated = (outputText: string): McpSuccessResponse => { if (outputText.length > MAX_LENGTH) { const truncationNotice = `<MCPTruncationWarning> ⚠️ TRUNCATED OUTPUT WARNING ⚠️ - Showing only most recent entries </MCPTruncationWarning>\n\n`; // Take the tail of the output text const truncatedText = truncationNotice + outputText.slice(-MAX_LENGTH + truncationNotice.length); return { content: [{ type: 'text' as const, text: truncatedText }], }; } return { content: [{ type: 'text' as const, text: outputText }], }; }; export default outputTextTruncated;

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/CircleCI-Public/mcp-server-circleci'

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