Skip to main content
Glama

ci_report

Analyze run artifacts to generate a regression report that identifies breaking changes in MCP server capabilities.

Instructions

Generate a CI regression report from run artifacts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
artifactsDirNoDirectory containing run artifacts. Defaults to .mcp-observatory/runs/

Implementation Reference

  • Core handler function that processes RunArtifact[] and builds a CiReport object with title, body, labels, regression detection, and counts.
    export function buildCiReport(artifacts: RunArtifact[]): CiReport {
      const today = new Date().toISOString().slice(0, 10);
      const failing = artifacts.filter((a) => a.gate === "fail");
      const failCount = failing.length;
      const hasRegressions = failCount > 0;
    
      const title = hasRegressions
        ? `MCP Observatory: ${failCount} regression${failCount === 1 ? "" : "s"} detected (${today})`
        : `MCP Observatory: all clear (${today})`;
    
      let body: string;
      if (!hasRegressions) {
        body =
          artifacts.length === 0
            ? "No run artifacts found. Nothing to report."
            : `All ${artifacts.length} server${artifacts.length === 1 ? "" : "s"} passed on ${today}.`;
      } else {
        const sections: string[] = [];
        for (const artifact of failing) {
          const targetId = artifact.target.targetId;
          const lines: string[] = [`## ${targetId}`];
    
          if (artifact.fatalError) {
            lines.push("", `> **Fatal error:** ${artifact.fatalError.split("\n")[0]}`);
          }
    
          const failingChecks = artifact.checks.filter(
            (ch) => ch.status === "fail" || ch.status === "partial",
          );
          for (const check of failingChecks) {
            lines.push(`> **${check.id}:** ${check.message}`);
          }
    
          if (failingChecks.length === 0 && !artifact.fatalError) {
            lines.push("> Gate failed (no specific check failures recorded).");
          }
    
          sections.push(lines.join("\n"));
        }
        body = sections.join("\n\n");
      }
    
      return {
        title,
        body,
        labels: ["mcp-observatory"],
        hasRegressions,
        serverCount: artifacts.length,
        failCount,
      };
    }
  • Type definition for the CiReport output shape returned by buildCiReport.
    export interface CiReport {
      title: string;
      body: string;
      labels: string[];
      hasRegressions: boolean;
      serverCount: number;
      failCount: number;
    }
  • src/server.ts:721-752 (registration)
    MCP server tool registration of 'ci_report' that reads artifacts from a directory and calls buildCiReport.
    server.tool(
      "ci_report",
      "Generate a CI regression report from run artifacts.",
      {
        artifactsDir: z.string().optional().describe("Directory containing run artifacts. Defaults to .mcp-observatory/runs/"),
      },
      async ({ artifactsDir }) => {
        const startMs = Date.now();
        try {
          const { readdir, readFile } = await import("node:fs/promises");
          const dir = artifactsDir ?? path.join(process.cwd(), ".mcp-observatory", "runs");
          const files = await readdir(dir);
          const artifacts: RunArtifact[] = [];
          for (const f of files) {
            if (!f.endsWith(".json")) continue;
            try {
              const raw = await readFile(path.join(dir, f), "utf8");
              const parsed = JSON.parse(raw) as Record<string, unknown>;
              if (parsed["artifactType"] === "run") artifacts.push(parsed as unknown as RunArtifact);
            } catch { /* skip invalid */ }
          }
    
          const report = buildCiReport(artifacts);
          logRequest("ci_report", startMs);
          return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          logRequest("ci_report", startMs, true);
          return { content: [{ type: "text", text: `CI report failed: ${msg}` }], isError: true };
        }
      },
    );
  • CLI command registration for 'ci-report' that loads artifacts and outputs the report in JSON or markdown.
    export function registerCiReportCommands(program: Command): void {
      program
        .command("ci-report")
        .description(
          "Generate a CI report from run artifacts for GitHub issue creation.",
        )
        .option(
          "--artifacts-dir <path>",
          "Directory containing run artifacts.",
          defaultRunsDirectory(process.cwd()),
        )
        .option("--format <format>", "Output format: json or markdown.", "json")
        .option("--no-color", "Disable colored output.")
        .action(
          async (options: { artifactsDir: string; format: string }) => {
            const artifacts = await loadArtifactsFromDir(options.artifactsDir);
            const report = buildCiReport(artifacts);
    
            if (options.format === "markdown") {
              process.stdout.write(report.body + "\n");
            } else {
              process.stdout.write(JSON.stringify(report, null, 2) + "\n");
            }
    
            recordEvent(buildEvent("command_complete", "ci-report", "cli", {
              nightlyScan: true,
              issueCreated: report.hasRegressions,
              matrixServerCount: report.serverCount,
              matrixFailCount: report.failCount,
            }));
    
            if (report.hasRegressions) {
              process.exitCode = 1;
            }
          },
        );
    }
  • Helper that loads and validates run artifacts from a directory for the CLI command.
    async function loadArtifactsFromDir(dir: string): Promise<RunArtifact[]> {
      let entries: string[];
      try {
        entries = await readdir(dir);
      } catch {
        return [];
      }
    
      const jsonFiles = entries.filter((f) => f.endsWith(".json")).sort();
      const artifacts: RunArtifact[] = [];
    
      for (const file of jsonFiles) {
        try {
          const content = await readFile(path.join(dir, file), "utf8");
          const data: unknown = JSON.parse(content);
          const artifact = validateRunArtifact(data);
          artifacts.push(artifact);
        } catch {
          // Skip invalid files silently
        }
      }
    
      return artifacts;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavior. It only states the action without side effects, permissions, error conditions, or what happens when the artifacts directory is missing. The agent lacks critical behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no unnecessary words. It is efficiently structured and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool lacks an output schema, yet the description does not clarify what the report contains, its format, or how to interpret results. Given the existence of many sibling tools, no comparative context is provided, leaving gaps in completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for the single parameter, so the description adds no extra meaning beyond the schema. The baseline of 3 is appropriate as the description does not leverage the opportunity to provide usage nuances.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'Generate' and explicit resource 'CI regression report' sourced from 'run artifacts', making the tool's purpose clear. However, it does not differentiate from sibling tools like diff_runs or get_history, which might cause confusion for an AI agent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no information on when to use this tool versus alternatives, nor does it specify context, prerequisites, or exclusions. An AI agent cannot determine if ci_report is the right choice over similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/KryptosAI/mcp-observatory'

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