jenkins_get_pending_actions
Retrieve pending input actions for a Jenkins build to check for required approvals or parameters before proceeding with the CI/CD pipeline.
Instructions
Obtener las acciones pendientes de input de un build
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | Nombre de la aplicación | |
| buildNumber | Yes | Número del build | |
| branch | No | Rama de Git (por defecto: main) |
Implementation Reference
- index.ts:198-228 (registration)MCP tool registration for 'jenkins_get_pending_actions', including input schema and handler function that calls JenkinsService and formats response.server.tool( "jenkins_get_pending_actions", "Obtener las acciones pendientes de input de un build", { 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().getPendingInputActions(args.app, args.buildNumber, args.branch || 'main'); const pendingText = `⏳ **Acciones Pendientes - Build #${args.buildNumber}**\n\n` + `**ID:** ${result.id}\n` + `**Proceed URL:** ${result.proceedUrl}\n` + `**Abort URL:** ${result.abortUrl}\n` + (result.message ? `**Mensaje:** ${result.message}\n` : '') + (result.inputs && result.inputs.length > 0 ? `**Inputs requeridos:**\n${result.inputs.map(input => `- ${input.name}: ${input.description || 'N/A'}`).join('\n')}` : ''); return { content: [{ type: "text", text: pendingText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; } } );
- tools/jenkins-service.ts:160-173 (handler)Core handler logic in JenkinsService: constructs Jenkins API URL for pending input actions and fetches data via Axios.async getPendingInputActions(app: string, buildNumber: number, branch: string = 'main'): Promise<PendingInputAction> { if (!validateAppName(app)) { throw new Error('Invalid app name.'); } const pendingInputUrl = `${buildJobBuildUrl('', app, buildNumber, branch)}/wfapi/nextPendingInputAction`; try { const response: AxiosResponse<PendingInputAction> = await this.client.get(pendingInputUrl); return response.data; } catch (error: any) { throw handleHttpError(error, `Failed to get pending input actions for app: ${app}, build: ${buildNumber}, branch: ${branch}`); } }
- index.ts:202-205 (schema)Input schema using Zod for validating tool parameters: app, buildNumber, and optional branch.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)") },