Class BuildLogsExtension

java.lang.Object
io.jenkins.plugins.mcp.server.extensions.BuildLogsExtension
All Implemented Interfaces:
ExtensionPoint, McpServerExtension

@Extension public class BuildLogsExtension extends Object implements McpServerExtension
  • Constructor Details

    • BuildLogsExtension

      public BuildLogsExtension()
  • Method Details

    • getBuildLog

      @Tool(description="Retrieves some log lines with pagination for a specific build or the last build of a Jenkins job, as well as a boolean value indicating whether there is more content to retrieve For sequential pagination, pass the returned \'nextCursor\' back as \'cursor\' to resume from the same spot without re-scanning. \'totalLines\' is exact for end-relative reads and -1 for forward reads (not computed). If \'nextCursor\' is set but \'hasMoreContent\' is false, you\'ve read everything written so far but the build is still going; keep the cursor and call again later to pick up whatever was appended in the meantime.", annotations=) public BuildLogsExtension.BuildLogResponse getBuildLog(@ToolParam(description="Job full name of the Jenkins job (e.g., \'folder/job-name\')") String jobFullName, @ToolParam(description="The build number (optional, if not provided, returns the last build)",required=false) Integer buildNumber, @ToolParam(description="The skip (optional, if not provided, returns from the first line). Negative values function as \'from the end\', with -1 meaning starting with the last line",required=false) Long skip, @ToolParam(description="The number of lines to return (optional, if not provided, returns 100 lines), positive values return lines from the start, negative values return lines from the end",required=false) Integer limit, @ToolParam(description="Opaque cursor previously returned as \'nextCursor\'. When set, reading resumes from that position; \'skip\' is ignored and \'startLine\', \'endLine\' and \'totalLines\' are reported as -1 (the cursor doesn\'t carry line numbers). The cursor is tied to the (job, buildNumber) it was issued for; passing it for a different build is rejected as invalid",required=false) String cursor)
    • searchBuildLog

      @Tool(description="Search for log lines matching a pattern in a specific build or the last build of a Jenkins job. Returns matching lines with their line numbers and context.", annotations=) public BuildLogsExtension.SearchLogResponse searchBuildLog(@ToolParam(description="Job full name of the Jenkins job (e.g., \'folder/job-name\')") String jobFullName, @ToolParam(description="The build number (optional, if not provided, searches the last build)",required=false) Integer buildNumber, @ToolParam(description="The search pattern (regex supported)") String pattern, @ToolParam(description="Whether to use regex pattern matching (default: false, uses simple string contains)",required=false) Boolean useRegex, @ToolParam(description="Whether the search should be case-insensitive (default: false)",required=false) Boolean ignoreCase, @ToolParam(description="Maximum number of matches to return (optional, default: 100, max: 1000)",required=false) Integer maxMatches, @ToolParam(description="Number of context lines to show before and after each match (default: 0)",required=false) Integer contextLines)