Skip to main content
Glama

diff_runs

Compare two run artifact files to identify regressions, recoveries, and schema drift in MCP server analysis.

Instructions

Compare two run artifact files and return the diff showing regressions, recoveries, and schema drift.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseYesPath to the base run artifact JSON file.
headYesPath to the head run artifact JSON file.

Implementation Reference

  • The `diff_runs` tool is registered and implemented directly in `src/server.ts`. It takes `base` and `head` artifact paths as input, reads them, computes the diff using `diffArtifacts`, and returns a markdown representation.
    server.tool(
      "diff_runs",
      "Compare two run artifact files and return the diff showing regressions, recoveries, and schema drift.",
      {
        base: z.string().describe("Path to the base run artifact JSON file."),
        head: z.string().describe("Path to the head run artifact JSON file."),
      },
      async ({ base, head }) => {
        try {
          const baseArtifact = await readArtifact(base);
          const headArtifact = await readArtifact(head);
    
          if (baseArtifact.artifactType !== "run" || headArtifact.artifactType !== "run") {
            return { content: [{ type: "text" as const, text: "Both files must be run artifacts (not diff artifacts)." }], isError: true };
          }
    
          const diff = diffArtifacts(baseArtifact, headArtifact);
          const markdown = renderMarkdown(diff);
          return { content: [{ type: "text" as const, text: markdown }] };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: "text" as const, text: `Error diffing runs: ${msg}` }], isError: true };
        }
      },
    );
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