Skip to main content
Glama
Jenkins MCP Server

Jenkins MCP Server

by TelmanH

Compare Builds

compare_builds
Read-onlyIdempotent

Compare good and bad Jenkins builds to see changes in results, duration, agents, stages, commits, and new errors; explain regressions or node-specific failures.

Instructions

What changed between a good and a bad build: result, duration, agent node, parameters, stage status/durations, commits in between (pipeline_changes = commits touching a Jenkinsfile or *.groovy), error groups that are new in the bad build, and env.log differences (if both builds archived env.log). Ideal for 'it worked yesterday', 'why is node A slower than node B' and for checking whether an error also occurs in green builds. good_on_node / bad_on_node pick builds by agent ('works on agent-01, fails on agent-03'; Pipeline jobs need up to 10 log reads); other_instance compares the same job across instances (no commit range).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "job": "<job>"
    },
    "name": "compare_builds"
  }
}

Input Schema

NameRequiredDescriptionDefault
badNoBuild number or permalink: lastBuild, lastFailedBuild, lastSuccessfulBuild, lastCompletedBuild, lastUnsuccessfulBuild. Empty = build from the URL, else lastBuild.lastFailedBuild
jobYesJob full name like 'cd/master/my-app' (folders separated by '/'), or a Jenkins job/build URL (instance is then detected from the URL).
goodNoBuild number or permalink: lastBuild, lastFailedBuild, lastSuccessfulBuild, lastCompletedBuild, lastUnsuccessfulBuild. Empty = build from the URL, else lastBuild.lastSuccessfulBuild
instanceNoJenkins instance name from list_instances. Empty = default instance.
bad_on_nodeNoPick the newest failed/unstable build that ran on this node (overrides bad)
good_on_nodeNoPick the newest successful build that ran on this node (overrides good)
other_instanceNoTake the GOOD build of the same job from this instance (cross-instance comparison)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld, yet the description still adds real behavior: env.log comparison only happens 'if both builds archived env.log', and Pipeline jobs using node selection may need 'up to 10 log reads', which signals cost. It also notes other_instance yields no commit range. A minor gap remains on output shape, though an output schema exists.

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

Conciseness4/5

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

Front-loaded with the core comparison, then use cases, then parameter caveats — a sensible order with no filler sentences. It is dense and slightly run-on due to stacked parentheticals, but each clause conveys information an agent needs.

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

Completeness5/5

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

For a 7-parameter comparison tool with full schema coverage, annotations for safety, and an output schema, the description covers purpose, alternatives, per-parameter intent, and known costs/caveats. Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuine semantics beyond it: it explains the intent of good_on_node/bad_on_node ('works on agent-01, fails on agent-03'), clarifies that pipeline_changes means commits touching a Jenkinsfile or *.groovy, and warns other_instance excludes the commit range. That is meaningful value on top of the schema.

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

Purpose5/5

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

Opens with a specific diff statement ('What changed between a good and a bad build') and enumerates the exact dimensions compared: result, duration, node, parameters, stage status, commits, new error groups, env.log. It is clearly a build-diff tool and is distinguishable from siblings like compare_artifacts and diff_job_config.

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

Usage Guidelines5/5

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

Names concrete scenarios ('it worked yesterday', 'why is node A slower than node B', checking whether an error also occurs in green builds) and explains the routing logic for the selector parameters (good_on_node/bad_on_node for per-agent comparisons, other_instance for cross-instance with the caveat 'no commit range'). This is explicit when-to-use guidance, not inferred.

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