Skip to main content
Glama
gcorroto
by gcorroto

jenkins_stop_job

Stop a running Jenkins job by specifying the application name and build number. Use this tool to halt ongoing CI/CD pipeline executions in Jenkins.

Instructions

Detener un job de Jenkins en ejecución

Input Schema

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

Implementation Reference

  • Core handler method that performs the HTTP POST request to stop the specified Jenkins build.
    async stopJob(app: string, buildNumber: number, branch: string = 'main'): Promise<string> {
      if (!validateAppName(app)) {
        throw new Error('Invalid app name.');
      }
    
      const jobUrl = `${buildJobBuildUrl('', app, buildNumber, branch)}/stop`;
      
      try {
        await this.client.post(jobUrl);
        return `Job stopped successfully for app ${app}, build ${buildNumber}, branch ${branch}`;
      } catch (error: any) {
        throw handleHttpError(error, `Failed to stop job for app: ${app}, build: ${buildNumber}, branch: ${branch}`);
      }
    }
  • index.ts:96-117 (registration)
    MCP tool registration for 'jenkins_stop_job', including input schema and wrapper handler that calls JenkinsService.stopJob.
    server.tool(
      "jenkins_stop_job",
      "Detener un job de Jenkins en ejecución",
      {
        app: z.string().describe("Nombre de la aplicación"),
        buildNumber: z.number().describe("Número del build a detener"),
        branch: z.string().optional().describe("Rama de Git (por defecto: main)")
      },
      async (args) => {
        try {
          const result = await getJenkinsService().stopJob(args.app, args.buildNumber, args.branch || 'main');
          
          return {
            content: [{ type: "text", text: `🛑 **${result}**` }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • Zod schema defining the input parameters for the jenkins_stop_job tool.
    {
      app: z.string().describe("Nombre de la aplicación"),
      buildNumber: z.number().describe("Número del build a detener"),
      branch: z.string().optional().describe("Rama de Git (por defecto: main)")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Detener' implies a destructive action, it doesn't specify whether this requires special permissions, if the stop is immediate or graceful, what happens to queued builds, or what the response looks like. For a mutation tool with zero annotation coverage, this is insufficient.

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 that gets straight to the point with no wasted words. It's appropriately sized for a tool with a clear, singular purpose.

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 destructive mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after stopping a job, what permissions are required, potential side effects, or what the tool returns. The combination of mutation nature and lack of structured documentation creates significant gaps.

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?

Schema description coverage is 100%, so the schema already documents all three parameters with clear descriptions. The description adds no additional parameter semantics beyond what's in the schema. The baseline of 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 clearly states the verb ('Detener' - stop) and resource ('un job de Jenkins en ejecución' - a running Jenkins job), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'jenkins_get_job_status' or 'jenkins_start_job' beyond the obvious action difference.

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 (e.g., the job must be running), when not to use it, or how it relates to sibling tools like 'jenkins_start_job' or 'jenkins_get_job_status'.

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