Skip to main content
Glama

mcp-server-circleci

Official
formatLatestPipelineStatus.ts1.51 kB
import { Workflow } from '../../clients/schemas.js'; import outputTextTruncated, { SEPARATOR } from '../outputTextTruncated.js'; export const formatLatestPipelineStatus = (workflows: Workflow[]) => { if (!workflows || workflows.length === 0) { return { content: [ { type: 'text' as const, text: 'No workflows found', }, ], }; } const outputText = workflows .map((workflow) => { let duration = 'unknown'; // Calculate duration from timestamps if duration field is not available if (workflow.created_at && workflow.stopped_at) { const startTime = new Date(workflow.created_at).getTime(); const endTime = new Date(workflow.stopped_at).getTime(); const durationInMinutes = Math.round( (endTime - startTime) / (1000 * 60), ); duration = `${durationInMinutes} minutes`; } const createdAt = new Date(workflow.created_at).toLocaleString(); const stoppedAt = workflow.stopped_at ? new Date(workflow.stopped_at).toLocaleString() : 'in progress'; const fields = [ `Pipeline Number: ${workflow.pipeline_number}`, `Workflow: ${workflow.name}`, `Status: ${workflow.status}`, `Duration: ${duration}`, `Created: ${createdAt}`, `Stopped: ${stoppedAt}`, ].filter(Boolean); return `${SEPARATOR}${fields.join('\n')}`; }) .join('\n'); return outputTextTruncated(outputText); };

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