Skip to main content
Glama
gcorroto
by gcorroto

jenkins_get_node_status

Check the status of a specific node in a Jenkins build to monitor pipeline execution and identify issues in CI/CD workflows.

Instructions

Obtener el estado de un nodo específico de un build

Input Schema

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

Implementation Reference

  • The MCP tool handler function that calls the JenkinsService to retrieve node status and formats the response as formatted text.
    async (args) => {
      try {
        const result = await getJenkinsService().getNodeStatus(args.app, args.buildNumber, args.nodeId, args.branch || 'main');
        
        let statusText: string;
        
        if ('proceedUrl' in result) {
          // Es un PendingInputAction
          statusText = `⏸️ **Nodo Esperando Input - ${args.nodeId}**\n\n` +
            `**ID:** ${result.id}\n` +
            `**Proceed URL:** ${result.proceedUrl}\n` +
            `**Abort URL:** ${result.abortUrl}\n` +
            (result.message ? `**Mensaje:** ${result.message}` : '');
        } else {
          // Es un NodeStatus normal
          statusText = `🔍 **Estado del Nodo: ${args.nodeId}**\n\n` +
            `**Nombre:** ${result.name}\n` +
            `**Estado:** ${result.status}\n` +
            `**Duración:** ${formatDuration(result.durationMillis)}\n` +
            `**Inicio:** ${formatTimestamp(result.startTimeMillis)}`;
        }
    
        return {
          content: [{ type: "text", text: statusText }],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
        };
      }
    }
  • Zod schema defining the input parameters for the jenkins_get_node_status tool.
    {
      app: z.string().describe("Nombre de la aplicación"),
      buildNumber: z.number().describe("Número del build"),
      nodeId: z.string().describe("ID del nodo"),
      branch: z.string().optional().describe("Rama de Git (por defecto: main)")
  • index.ts:155-195 (registration)
    Registration of the jenkins_get_node_status tool using server.tool, including description, schema, and handler.
    server.tool(
      "jenkins_get_node_status",
      "Obtener el estado de un nodo específico de un build",
      {
        app: z.string().describe("Nombre de la aplicación"),
        buildNumber: z.number().describe("Número del build"),
        nodeId: z.string().describe("ID del nodo"),
        branch: z.string().optional().describe("Rama de Git (por defecto: main)")
      },
      async (args) => {
        try {
          const result = await getJenkinsService().getNodeStatus(args.app, args.buildNumber, args.nodeId, args.branch || 'main');
          
          let statusText: string;
          
          if ('proceedUrl' in result) {
            // Es un PendingInputAction
            statusText = `⏸️ **Nodo Esperando Input - ${args.nodeId}**\n\n` +
              `**ID:** ${result.id}\n` +
              `**Proceed URL:** ${result.proceedUrl}\n` +
              `**Abort URL:** ${result.abortUrl}\n` +
              (result.message ? `**Mensaje:** ${result.message}` : '');
          } else {
            // Es un NodeStatus normal
            statusText = `🔍 **Estado del Nodo: ${args.nodeId}**\n\n` +
              `**Nombre:** ${result.name}\n` +
              `**Estado:** ${result.status}\n` +
              `**Duración:** ${formatDuration(result.durationMillis)}\n` +
              `**Inicio:** ${formatTimestamp(result.startTimeMillis)}`;
          }
    
          return {
            content: [{ type: "text", text: statusText }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • JenkinsService.getNodeStatus method that performs the API call to retrieve the node status from Jenkins workflow API and handles special PAUSED_PENDING_INPUT case.
    async getNodeStatus(app: string, buildNumber: number, nodeId: string, branch: string = 'main'): Promise<NodeStatus | PendingInputAction> {
      if (!validateAppName(app)) {
        throw new Error('Invalid app name.');
      }
    
      const nodeUrl = `${buildJobBuildUrl('', app, buildNumber, branch)}/execution/node/${nodeId}/wfapi/describe`;
      
      try {
        const response: AxiosResponse<NodeStatus> = await this.client.get(nodeUrl);
        const nodeDetails = response.data;
        
        // Si el estado es PAUSED_PENDING_INPUT, obtener los detalles de input pending
        if (nodeDetails.status === 'PAUSED_PENDING_INPUT') {
          return await this.getPendingInputActions(app, buildNumber, branch);
        }
        
        return nodeDetails;
      } catch (error: any) {
        throw handleHttpError(error, `Failed to get node status for app: ${app}, build: ${buildNumber}, node: ${nodeId}, branch: ${branch}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Obtener el estado' implies a read-only operation, the description doesn't address authentication requirements, rate limits, error conditions, or what the status response might contain. For a tool that presumably interacts with a CI/CD system, this lack of behavioral context is a significant gap.

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 Spanish sentence that states the core purpose without unnecessary words. It's appropriately sized for a straightforward status-checking tool and gets directly to the point with no wasted verbiage.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what kind of status information is returned, what format it might be in, or how to interpret the results. Given the complexity of Jenkins build systems and the lack of structured metadata, the description should provide more operational context.

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 description mentions 'un nodo específico de un build' which relates to the 'nodeId' and 'buildNumber' parameters, but doesn't add meaningful context beyond what the 100% schema coverage already provides. The schema descriptions clearly explain each parameter's purpose, so the description adds minimal value here. This meets the baseline for high schema coverage.

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 clearly states the verb ('Obtener el estado' - Get status) and resource ('de un nodo específico de un build' - of a specific node of a build), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'jenkins_get_job_status' or 'jenkins_get_build_steps', which would require more specific language about what distinguishes node status from other status checks.

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. There's no mention of prerequisites, when this tool is appropriate versus other Jenkins status tools, or what context would require checking node status specifically rather than job or build status. The agent receives no usage context beyond the basic purpose.

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