Skip to main content
Glama
leorosignoli

JIRA Zephyr MCP Server

by leorosignoli

generate_test_report

Generate test execution reports in JSON or HTML format from JIRA Zephyr test cycles to track testing progress and results.

Instructions

Generate test execution report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cycleIdYesTest cycle ID
formatNoReport format (default: JSON)

Implementation Reference

  • Main handler function for generate_test_report tool. Validates input, calls Zephyr client to get report data, generates HTML if requested, and returns formatted report.
    export const generateTestReport = async (input: GenerateTestReportInput) => {
      const validatedInput = generateTestReportSchema.parse(input);
      
      try {
        const report = await getZephyrClient().generateTestReport(validatedInput.cycleId);
        
        if (validatedInput.format === 'HTML') {
          const htmlReport = generateHtmlReport(report);
          return {
            success: true,
            data: {
              format: 'HTML',
              content: htmlReport,
              generatedOn: report.generatedOn,
            },
          };
        }
        
        return {
          success: true,
          data: {
            format: 'JSON',
            content: report,
            generatedOn: report.generatedOn,
          },
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.response?.data?.message || error.message,
        };
      }
    };
  • Helper function to generate HTML report from the test execution data.
    const generateHtmlReport = (report: any) => {
      return `
        <!DOCTYPE html>
        <html>
        <head>
          <title>Test Execution Report - ${report.cycleName}</title>
          <style>
            body { font-family: Arial, sans-serif; margin: 20px; }
            .header { background-color: #f5f5f5; padding: 20px; border-radius: 5px; }
            .summary { display: flex; gap: 20px; margin: 20px 0; }
            .metric { background-color: #e8f4f8; padding: 15px; border-radius: 5px; text-align: center; }
            .metric h3 { margin: 0 0 10px 0; }
            .metric .value { font-size: 24px; font-weight: bold; }
            .executions { margin-top: 30px; }
            .execution { padding: 10px; border-left: 4px solid #ddd; margin: 10px 0; }
            .execution.pass { border-left-color: #4caf50; }
            .execution.fail { border-left-color: #f44336; }
            .execution.blocked { border-left-color: #ff9800; }
            .execution.progress { border-left-color: #2196f3; }
          </style>
        </head>
        <body>
          <div class="header">
            <h1>Test Execution Report</h1>
            <h2>${report.cycleName}</h2>
            <p>Project: ${report.projectKey}</p>
            <p>Generated: ${new Date(report.generatedOn).toLocaleString()}</p>
          </div>
          
          <div class="summary">
            <div class="metric">
              <h3>Total Tests</h3>
              <div class="value">${report.summary.total}</div>
            </div>
            <div class="metric">
              <h3>Passed</h3>
              <div class="value">${report.summary.passed}</div>
            </div>
            <div class="metric">
              <h3>Failed</h3>
              <div class="value">${report.summary.failed}</div>
            </div>
            <div class="metric">
              <h3>Blocked</h3>
              <div class="value">${report.summary.blocked}</div>
            </div>
            <div class="metric">
              <h3>Pass Rate</h3>
              <div class="value">${Math.round(report.summary.passRate)}%</div>
            </div>
          </div>
          
          <div class="executions">
            <h3>Test Executions</h3>
            ${report.executions.map((exec: any) => `
              <div class="execution ${exec.status.toLowerCase()}">
                <strong>${exec.key}</strong> - ${exec.status}
                ${exec.comment ? `<p>${exec.comment}</p>` : ''}
                ${exec.defects.length > 0 ? `<p>Defects: ${exec.defects.map((d: any) => d.key).join(', ')}</p>` : ''}
              </div>
            `).join('')}
          </div>
        </body>
        </html>
      `;
    };
  • Zod schema for validating GenerateTestReportInput, used in the handler and MCP dispatch.
    export const generateTestReportSchema = z.object({
      cycleId: z.string().min(1, 'Cycle ID is required'),
      format: z.enum(['JSON', 'HTML']).default('JSON'),
    });
  • src/index.ts:172-182 (registration)
    Tool registration in the TOOLS array, defining name, description, and inputSchema for MCP.
      name: 'generate_test_report',
      description: 'Generate test execution report',
      inputSchema: {
        type: 'object',
        properties: {
          cycleId: { type: 'string', description: 'Test cycle ID' },
          format: { type: 'string', enum: ['JSON', 'HTML'], description: 'Report format (default: JSON)' },
        },
        required: ['cycleId'],
      },
    },
  • src/index.ts:425-435 (registration)
    Dispatch handler in the MCP CallToolRequest switch statement that invokes the generateTestReport function.
    case 'generate_test_report': {
      const validatedArgs = validateInput<GenerateTestReportInput>(generateTestReportSchema, args, 'generate_test_report');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(await generateTestReport(validatedArgs), null, 2),
          },
        ],
      };
    }
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 of behavioral disclosure. 'Generate' implies a read-only or creation operation, but the description doesn't specify if it's a read (e.g., retrieving a report) or a write (e.g., creating a new report), nor does it cover permissions, side effects, or output format. 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 phrase ('Generate test execution report') with zero wasted words. It's appropriately sized and front-loaded, making it easy to parse 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 generating a report (which may involve data processing and formatting), the lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the report contains, how it's generated, or what the return value looks like, leaving critical gaps for the agent.

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 input schema has 100% description coverage, with clear documentation for 'cycleId' and 'format' (including enum values and default). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 without compensating or adding extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Generate test execution report' states the verb ('Generate') and resource ('test execution report'), which provides a basic understanding of the tool's purpose. However, it lacks specificity about what constitutes a 'test execution report' and doesn't differentiate from sibling tools like 'get_test_execution_status' or 'execute_test', making it somewhat vague.

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., needing a test cycle ID), exclusions, or comparisons to siblings like 'get_test_execution_status' or 'execute_test', leaving the agent without context for tool selection.

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/leorosignoli/jira-zephyr-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server