Skip to main content
Glama
gcorroto
by gcorroto

jenkins_get_build_steps

Retrieve the status of steps for a specific Jenkins build to monitor CI/CD pipeline execution progress and identify issues in application deployments.

Instructions

Obtener el estado de los steps de un build específico

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appYesNombre de la aplicación
buildNumberYesNúmero del build
branchNoRama de Git (por defecto: main)

Implementation Reference

  • MCP tool handler function for 'jenkins_get_build_steps': invokes JenkinsService.getJobStepsStatus, formats the build steps and stages into a markdown text response.
    async (args) => {
      try {
        const result = await getJenkinsService().getJobStepsStatus(args.app, args.buildNumber, args.branch || 'main');
        
        const stepsText = `📋 **Steps del Build #${args.buildNumber} - ${args.app}**\n\n` +
          `**ID:** ${result.id}\n` +
          `**Nombre:** ${result.name}\n` +
          `**Estado:** ${result.status}\n` +
          `**Duración:** ${formatDuration(result.durationMillis)}\n` +
          `**Inicio:** ${formatTimestamp(result.startTimeMillis)}\n\n` +
          `**Stages (${result.stages.length}):**\n` +
          result.stages.map(stage => 
            `- **${stage.name}** (${stage.status}) - ${formatDuration(stage.durationMillis)}`
          ).join('\n');
    
        return {
          content: [{ type: "text", text: stepsText }],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
        };
      }
    }
  • Input schema for the tool using Zod validation: app (required string), buildNumber (required number), branch (optional string).
    {
      app: z.string().describe("Nombre de la aplicación"),
      buildNumber: z.number().describe("Número del build"),
      branch: z.string().optional().describe("Rama de Git (por defecto: main)")
    },
  • index.ts:120-152 (registration)
    Registration of the 'jenkins_get_build_steps' tool with the MCP server, including name, description, input schema, and handler.
    server.tool(
      "jenkins_get_build_steps",
      "Obtener el estado de los steps de un build específico",
      {
        app: z.string().describe("Nombre de la aplicación"),
        buildNumber: z.number().describe("Número del build"),
        branch: z.string().optional().describe("Rama de Git (por defecto: main)")
      },
      async (args) => {
        try {
          const result = await getJenkinsService().getJobStepsStatus(args.app, args.buildNumber, args.branch || 'main');
          
          const stepsText = `📋 **Steps del Build #${args.buildNumber} - ${args.app}**\n\n` +
            `**ID:** ${result.id}\n` +
            `**Nombre:** ${result.name}\n` +
            `**Estado:** ${result.status}\n` +
            `**Duración:** ${formatDuration(result.durationMillis)}\n` +
            `**Inicio:** ${formatTimestamp(result.startTimeMillis)}\n\n` +
            `**Stages (${result.stages.length}):**\n` +
            result.stages.map(stage => 
              `- **${stage.name}** (${stage.status}) - ${formatDuration(stage.durationMillis)}`
            ).join('\n');
    
          return {
            content: [{ type: "text", text: stepsText }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • Core helper method in JenkinsService that performs the HTTP request to Jenkins /wfapi/describe endpoint to retrieve the build steps status (BuildSteps type).
    async getJobStepsStatus(app: string, buildNumber: number, branch: string = 'main'): Promise<BuildSteps> {
      if (!validateAppName(app)) {
        throw new Error('Invalid app name.');
      }
    
      const stepsUrl = `${buildJobBuildUrl('', app, buildNumber, branch)}/wfapi/describe`;
      
      try {
        const response: AxiosResponse<BuildSteps> = await this.client.get(stepsUrl);
        return response.data;
      } catch (error: any) {
        if (error.response?.status === 404) {
          throw new JenkinsError(`Build steps not found for app: ${app}, build: ${buildNumber}, branch: ${branch}`);
        }
        throw handleHttpError(error, `Failed to get job steps for app: ${app}, build: ${buildNumber}, branch: ${branch}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states it retrieves status but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what 'estado' entails (e.g., success/failure, duration). This is a significant gap for a tool with no annotation coverage.

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?

The description is a single, efficient sentence in Spanish that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with every word earning its place.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'estado' includes (e.g., step names, outcomes, logs) or address complexity like handling multiple builds. For a tool with 3 parameters and no structured output, more context is needed.

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?

The schema description coverage is 100%, so the schema already documents all three parameters (app, buildNumber, branch). The description adds no additional meaning beyond what the schema provides, such as clarifying how 'app' relates to Jenkins jobs or the format of 'estado'. Baseline 3 is appropriate when the schema does the heavy lifting.

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 description 'Obtener el estado de los steps de un build específico' clearly states the action (obtener/retrieve) and resource (steps de un build específico). It distinguishes from siblings like 'jenkins_get_job_status' by focusing on build steps rather than job status, though it doesn't explicitly contrast with them.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, when not to use it, or refer to sibling tools like 'jenkins_get_job_status' for broader job information.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gcorroto/mcp-jenkins'

If you have feedback or need assistance with the MCP directory API, please join our Discord server