Skip to main content
Glama
Jenkins MCP Server

Jenkins MCP Server

by TelmanH

Get Stage Log

get_stage_log
Read-onlyIdempotent

Retrieve errors and the last meaningful lines from one Jenkins pipeline stage (default: the failed stage) to diagnose failures without reading the full log.

Instructions

Errors and the last meaningful lines of ONE pipeline stage (default: the failed stage). Much cheaper than the full log. Lines of parallel branches can interleave in the console; exact=True reads the stage step by step from wfapi instead (falls back to the console without the plugin).

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": "get_stage_log"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobYesJob full name like 'cd/master/my-app' (folders separated by '/'), or a Jenkins job/build URL (instance is then detected from the URL).
buildNoBuild number or permalink: lastBuild, lastFailedBuild, lastSuccessfulBuild, lastCompletedBuild, lastUnsuccessfulBuild. Empty = build from the URL, else lastBuild.
exactNoPer-step log from the Stage View API (wfapi): exact for parallel branches; more requests
stageNoStage name; empty = the failed stage
instanceNoJenkins instance name from list_instances. Empty = default instance.
max_linesNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the read-only/idempotent/open-world profile, so the description is free to add real behavioral context: cost tradeoff vs. the full log, line interleaving in parallel branches, and that exact=True issues more requests and silently falls back to console scraping if the wfapi plugin is absent. That fallback caveat is exactly the kind of thing an agent needs and the schema cannot express.

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?

Three dense sentences with the primary scope front-loaded, followed by the cost rationale and then the precision/escalation option. No restatement of the tool name or title, no filler.

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

Completeness4/5

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

An output schema exists, so return shape needn't be described, and annotations carry the safety profile. The description supplies the cost model and the exact-mode fallback, which covers the main decision risk; only minor gaps remain around truncation behavior via max_lines.

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 83%, so the schema already documents job/build/stage/instance forms. The description still adds meaning for the two parameters where behavior matters most: stage defaults to the failed stage, and exact switches data source and degrades gracefully without the plugin. Only max_lines and the cost implication of exact ('more requests') are left under-explained.

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?

States a specific resource (ONE pipeline stage log) and the returned content (errors plus last meaningful lines), with the default scope (the failed stage) called out. It contrasts with 'the full log' but never names the sibling tool (get_log_lines / get_log_errors / search_log) that an agent must choose between.

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

Usage Guidelines3/5

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

'Much cheaper than the full log' implies the selection rule (prefer this over the complete log), and 'exact=True ... falls back to the console without the plugin' gives a condition for the alternative mode. But the routing is implicit, not explicit: no sibling names, no statement of when this tool is the wrong choice.

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