Skip to main content
Glama

IT-MCP

by acampkin95
reportingHub.ts2.27 kB
import { randomUUID } from "node:crypto"; import type { StructuredThinkingService, ThoughtMetadata } from "./structuredThinking.js"; export type ReportImportance = ThoughtMetadata["importance"]; export interface ToolReport { readonly tool: string; readonly summary: string; readonly sections?: Record<string, string>; readonly stage?: string; readonly tags?: readonly string[]; readonly references?: readonly string[]; readonly importance?: ReportImportance; readonly devOpsCategory?: string; readonly debugLayer?: string; readonly runtimeStack?: readonly string[]; readonly executionContext?: string; } export interface ReportCaptureResult { readonly thoughtId: string; readonly stage: string; readonly summary: string; } export class ReportingHubService { public constructor(private readonly structuredThinking: StructuredThinkingService) {} public capture(report: ToolReport): ReportCaptureResult { const stage = report.stage ?? "analysis"; const narrative = this.composeNarrative(report); const metadata: ThoughtMetadata = { source: report.tool, tags: report.tags, references: report.references, importance: report.importance ?? "medium", devOpsCategory: report.devOpsCategory, debugLayer: report.debugLayer, runtimeStack: report.runtimeStack, stageLabel: stage, nextThoughtNeeded: false, }; const timeline = this.structuredThinking.trackThoughts( [ { stage, thought: narrative, metadata, }, ], true, ); const lastRecord = timeline.timeline.at(-1); return { thoughtId: lastRecord?.id ?? randomUUID(), stage, summary: report.summary, }; } private composeNarrative(report: ToolReport): string { const lines: string[] = []; lines.push(`[${report.tool}] ${report.summary}`); if (report.executionContext) { lines.push(`Context: ${report.executionContext}`); } if (report.sections && Object.keys(report.sections).length) { for (const [key, value] of Object.entries(report.sections)) { if (!value) { continue; } lines.push(`${key}: ${value}`); } } return lines.join("\n"); } }

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/acampkin95/MCP'

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