Skip to main content
Glama

jenkins_stop_job

Stop a running Jenkins job by specifying the application name and build number. Ideal for managing CI/CD pipelines efficiently on the MCP-Jenkins server.

Instructions

Detener un job de Jenkins en ejecución

Input Schema

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

Implementation Reference

  • Core handler function that stops a Jenkins build by POSTing to the /stop endpoint using axios.
    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)
    Registers the jenkins_stop_job tool with MCP server, defines input schema using Zod, and provides a thin wrapper handler that calls JenkinsService.stopJob and formats the response.
    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}` }], }; } } );
  • Input schema validation using Zod for app name, build number, and optional branch.
    { 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)")

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