Skip to main content
Glama
Jenkins MCP Server

Jenkins MCP Server

by TelmanH

Search Log

search_log
Read-onlyIdempotent

Search Jenkins build logs for regex matches and return matching lines with surrounding context and line numbers, optionally limited to a specific stage.

Instructions

grep -C for a build log: matching lines with context lines around them and line numbers. Optionally restricted to one stage. Reports the total number of matches even if only max_matches are shown.

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>",
      "pattern": "<pattern>"
    },
    "name": "search_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.
stageNo
contextNo
patternYesPython regex (invalid regex is treated as literal text)
instanceNoJenkins instance name from list_instances. Empty = default instance.
ignore_caseNo
max_matchesNo

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 safety profile (readOnly, idempotent, openWorld), and the description still adds real behavioral context: results are truncated at max_matches but the total match count is always reported, so an agent knows it can detect hidden matches. It stops short of describing the output shape or what happens on zero matches, but the truncation disclosure is the substantive part.

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 tight sentences, front-loaded with the grep analogy that carries most of the explanatory weight, then two qualifications. No filler and nothing repeated from the schema.

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?

An output schema exists, so return-value detail is unnecessary, and the schema documents the job/build/instance parameters. For an 8-parameter read-only search tool, the description supplies the behaviors an agent cannot get from structured fields: context semantics, stage scoping, and truncation with total-count reporting.

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?

At 50% schema coverage the description must compensate, and it does for three of eight parameters: `context` (lines around the match), `stage` (optional restriction to one stage), and `max_matches` (a cap, with total matches still reported). The remaining parameters (job, build, instance, ignore_case) are either covered by the schema or left unaddressed, so the description adds partial rather than full meaning.

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 'grep -C for a build log' framing states a precise verb+resource and immediately conveys the differentiating behavior (matching lines plus surrounding context and line numbers). It implicitly separates itself from full-log siblings like get_log_lines and get_stage_log, but never names an alternative explicitly.

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?

'Optionally restricted to one stage' and the grep analogy imply when the tool fits, but there is no explicit guidance on when to prefer it over get_log_lines, get_log_errors, or get_stage_log, nor any stated prerequisites. The usage is inferable rather than directed.

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