Skip to main content
Glama

CircleCI MCP Server

by ampcome-mcps
outputTextTruncated.ts•969 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/ampcome-mcps/circleci-mcp'

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