Search Log
search_logSearch 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
| Name | Required | Description | Default |
|---|---|---|---|
| job | Yes | Job full name like 'cd/master/my-app' (folders separated by '/'), or a Jenkins job/build URL (instance is then detected from the URL). | |
| build | No | Build number or permalink: lastBuild, lastFailedBuild, lastSuccessfulBuild, lastCompletedBuild, lastUnsuccessfulBuild. Empty = build from the URL, else lastBuild. | |
| stage | No | ||
| context | No | ||
| pattern | Yes | Python regex (invalid regex is treated as literal text) | |
| instance | No | Jenkins instance name from list_instances. Empty = default instance. | |
| ignore_case | No | ||
| max_matches | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |