Read Workspace File
read_workspace_fileReads a text file from a Jenkins job workspace, optionally grepping a pattern or returning numbered lines, to inspect unarchived logs and current agent files.
Instructions
Read a text file from a job's workspace (e.g. a log the build did not archive). With pattern it
greps (regex, case-insensitive); otherwise count lines from start (0 = tail). UTF-8, UTF-16 and
cp1252 are decoded, binary files refused, secrets masked. Shows the CURRENT file on the agent.
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>",
"path": "<path>"
},
"name": "read_workspace_file"
}
}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). | |
| path | Yes | File path inside the workspace | |
| build | No | Build number or permalink: lastBuild, lastFailedBuild, lastSuccessfulBuild, lastCompletedBuild, lastUnsuccessfulBuild. Empty = build from the URL, else lastBuild. | |
| count | No | ||
| start | No | ||
| node_id | No | Pipeline only: workspace of which node block (node_id from list_workspace); empty = the only one | |
| pattern | No | ||
| instance | No | Jenkins instance name from list_instances. Empty = default instance. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |