Skip to main content
Glama
gcorroto
by gcorroto

jenkins_get_coverage_paths

Retrieve file paths with coverage data from Jenkins builds to analyze test coverage reports for specific applications and build numbers.

Instructions

Obtener todos los paths de archivos con cobertura

Input Schema

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

Implementation Reference

  • index.ts:338-364 (registration)
    Registration of the jenkins_get_coverage_paths tool, including input schema and inline handler function that delegates to JenkinsService and formats the response.
    server.tool(
      "jenkins_get_coverage_paths",
      "Obtener todos los paths de archivos con cobertura",
      {
        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().getCoverageReportPaths(args.app, args.buildNumber, args.branch || 'main');
          
          const pathsText = `📂 **Paths de Cobertura - Build #${args.buildNumber}**\n\n` +
            `**Total de archivos:** ${result.length}\n\n` +
            result.slice(0, 20).map((path, index) => `${index + 1}. ${path}`).join('\n') +
            (result.length > 20 ? `\n\n... y ${result.length - 20} archivos más` : '');
    
          return {
            content: [{ type: "text", text: pathsText }],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `❌ **Error:** ${error.message}` }],
          };
        }
      }
    );
  • Core implementation of the coverage paths retrieval in JenkinsService, fetching frontend coverage report and extracting paths.
    async getCoverageReportPaths(app: string, buildNumber: number, branch: string = 'main'): Promise<string[]> {
      if (!validateAppName(app)) {
        throw new Error('Invalid app name.');
      }
    
      try {
        const frontendReport = await this.getCoverageReportFrontend(app, buildNumber, branch);
        return this.getAllPaths(frontendReport);
      } catch (error: any) {
        throw handleHttpError(error, `Failed to get coverage paths for app: ${app}, build: ${buildNumber}, branch: ${branch}`);
      }
    }
  • Helper function to extract all file paths from the coverage report object.
    private getAllPaths(report: CoverageReportFront): string[] {
      return Object.values(report.files).map(file => file.path);
    }
  • Zod input schema for the tool parameters.
    {
      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)")
    },
  • Helper to fetch the frontend coverage report ZIP from Jenkins (currently returns empty).
    private async getCoverageReportFrontend(app: string, buildNumber: number, branch: string = 'main'): Promise<CoverageReportFront> {
      const zipUrl = `${buildJobBuildUrl('', app, buildNumber, branch)}/Coverage_20Unit_20Test_20Report/*zip*/Coverage_20Unit_20Test_20Report.zip`;
      
      const response = await this.client.get(zipUrl, { responseType: 'arraybuffer' });
      
      // Aquí deberías extraer y procesar el ZIP
      // Por simplicidad, devolvemos un reporte vacío
      return { files: {} };
    }
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's a read operation ('obtener'), implying it's non-destructive, but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what the output format looks like (e.g., list of paths). 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's appropriately sized and front-loaded, making it easy to understand quickly.

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 the complexity of a Jenkins coverage tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral aspects, usage context, and output format, which are crucial for an AI agent to invoke it correctly. The description should compensate for the missing structured data but doesn't.

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 (app, buildNumber, branch) with descriptions. The description doesn't add any meaning beyond what the schema provides, such as explaining how these parameters interact or affect the results. 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 clearly states the action ('obtener todos los paths de archivos') and the resource ('con cobertura'), which translates to 'get all file paths with coverage'. It specifies the verb and resource, but doesn't differentiate from sibling tools like 'jenkins_get_coverage_lines' or 'jenkins_get_coverage_report', which also deal with coverage data.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools or contexts where this specific tool is appropriate, such as distinguishing it from 'jenkins_get_coverage_lines' for line-level details or 'jenkins_get_coverage_report' for summary reports.

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