Skip to main content
Glama

generate_report

Create penetration test reports in multiple formats to document security assessment findings and vulnerabilities for authorized testing targets.

Instructions

Generate comprehensive penetration test report

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget identifier
formatNoReport format

Implementation Reference

  • Core handler function that implements the generate_report tool logic: compiles pentest report data, formats it (HTML, Markdown, JSON, PDF), generates filename, and returns structured ScanResult.
    async generateReport(target: string, format: 'html' | 'pdf' | 'json' | 'markdown' = 'html'): Promise<ScanResult> {
      try {
        // This would typically load results from a database or file system
        // For now, we'll create a sample report structure
        
        const report = await this.compileReport(target);
        
        let formattedReport: string;
        
        switch (format) {
          case 'html':
            formattedReport = this.generateHTMLReport(report);
            break;
          case 'markdown':
            formattedReport = this.generateMarkdownReport(report);
            break;
          case 'json':
            formattedReport = JSON.stringify(report, null, 2);
            break;
          case 'pdf':
            formattedReport = 'PDF generation requires additional dependencies';
            break;
          default:
            formattedReport = this.generateMarkdownReport(report);
        }
        
        // Save report to file
        const filename = `pentest_report_${target.replace(/[^a-zA-Z0-9]/g, '_')}_${new Date().toISOString().split('T')[0]}.${format}`;
        
        return {
          target,
          timestamp: new Date().toISOString(),
          tool: 'generate_report',
          results: {
            report_content: formattedReport,
            filename,
            format,
            report_summary: {
              total_vulnerabilities: report.vulnerability_details.length,
              successful_exploits: report.exploitation_summary.successful_exploits,
              risk_rating: report.executive_summary.risk_rating
            }
          },
          status: 'success'
        };
        
      } catch (error) {
        return {
          target,
          timestamp: new Date().toISOString(),
          tool: 'generate_report',
          results: {},
          status: 'error',
          error: error instanceof Error ? error.message : String(error)
        };
      }
    }
  • MCP tool schema definition including input schema with 'target' (required) and 'format' (optional enum: html/pdf/json/markdown).
      name: "generate_report",
      description: "Generate comprehensive penetration test report",
      inputSchema: {
        type: "object",
        properties: {
          target: { type: "string", description: "Target identifier" },
          format: { 
            type: "string", 
            enum: ["html", "pdf", "json", "markdown"],
            description: "Report format" 
          }
        },
        required: ["target"]
      }
    },
  • src/index.ts:542-543 (registration)
    Tool registration in MCP CallToolRequest handler: switch case dispatches generate_report calls to this.reportTools.generateReport().
    case "generate_report":
      return respond(await this.reportTools.generateReport(args.target, args.format || "html"));
  • TypeScript interfaces defining the structure of PentestReport, ExecutiveSummary, and related types used for report validation and structure.
    export interface PentestReport {
      report_id: string;
      target: string;
      generated_at: string;
      scope: string;
      methodology: string;
      executive_summary: ExecutiveSummary;
      technical_findings: TechnicalFindings;
      vulnerability_details: VulnerabilityDetail[];
      exploitation_summary: ExploitationSummary;
      recommendations: RecommendationSection;
      appendices: AppendixSection;
    }
    
    export interface ExecutiveSummary {
      assessment_overview: string;
      key_findings: string[];
      risk_rating: 'Low' | 'Medium' | 'High' | 'Critical';
      business_impact: string;
      remediation_priority: string[];
    }
    
    export interface TechnicalFindings {
      methodology_used: string[];
      scope_coverage: string;
      tools_utilized: string[];
      timeline: string;
      limitations: string[];
    }
    
    export interface VulnerabilityDetail {
      id: string;
      title: string;
      severity: string;
      cvss_score?: number;
      description: string;
      impact: string;
      affected_systems: string[];
      evidence: string[];
      proof_of_concept: string;
      remediation: string;
      references: string[];
    }
    
    export interface ExploitationSummary {
      successful_exploits: number;
      attempted_exploits: number;
      compromise_level: 'None' | 'Limited' | 'Significant' | 'Complete';
      access_gained: string[];
      data_accessed: string[];
    }
    
    export interface RecommendationSection {
      immediate_actions: string[];
      short_term_goals: string[];
      long_term_strategy: string[];
      security_controls: string[];
    }
    
    export interface AppendixSection {
      raw_scan_outputs: any[];
      port_scan_results: any[];
      vulnerability_scan_details: any[];
      exploitation_logs: any[];
    }
  • ReportTools class containing the generateReport handler and supporting helper methods (compileReport, generateHTMLReport, generateMarkdownReport, etc.). Instantiated in src/index.ts.
    export class ReportTools {
    
      async generateReport(target: string, format: 'html' | 'pdf' | 'json' | 'markdown' = 'html'): Promise<ScanResult> {
        try {
          // This would typically load results from a database or file system
          // For now, we'll create a sample report structure
          
          const report = await this.compileReport(target);
          
          let formattedReport: string;
          
          switch (format) {
            case 'html':
              formattedReport = this.generateHTMLReport(report);
              break;
            case 'markdown':
              formattedReport = this.generateMarkdownReport(report);
              break;
            case 'json':
              formattedReport = JSON.stringify(report, null, 2);
              break;
            case 'pdf':
              formattedReport = 'PDF generation requires additional dependencies';
              break;
            default:
              formattedReport = this.generateMarkdownReport(report);
          }
          
          // Save report to file
          const filename = `pentest_report_${target.replace(/[^a-zA-Z0-9]/g, '_')}_${new Date().toISOString().split('T')[0]}.${format}`;
          
          return {
            target,
            timestamp: new Date().toISOString(),
            tool: 'generate_report',
            results: {
              report_content: formattedReport,
              filename,
              format,
              report_summary: {
                total_vulnerabilities: report.vulnerability_details.length,
                successful_exploits: report.exploitation_summary.successful_exploits,
                risk_rating: report.executive_summary.risk_rating
              }
            },
            status: 'success'
          };
          
        } catch (error) {
          return {
            target,
            timestamp: new Date().toISOString(),
            tool: 'generate_report',
            results: {},
            status: 'error',
            error: error instanceof Error ? error.message : String(error)
          };
        }
      }
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. It mentions 'generate' and 'comprehensive', but doesn't clarify whether this is a read-only operation, if it requires specific inputs beyond the schema, what the output entails (e.g., file generation, data return), or any side effects like rate limits or authentication needs. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Generate comprehensive penetration test report'. It's front-loaded with the core action and resource, with no wasted words. However, it could be slightly more informative without sacrificing conciseness, such as by hinting at output or usage context.

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 penetration testing and the lack of annotations and output schema, the description is incomplete. It doesn't address what the tool returns (e.g., a file, report data), how it integrates with other tools in the sibling list, or any behavioral nuances. For a tool in a security testing context with no structured output information, this leaves the agent under-informed about its full role and results.

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 schema description coverage is 100%, with clear descriptions for both parameters (target and format with enum). The description adds no additional meaning beyond the schema—it doesn't explain what 'target identifier' entails or provide context for format choices. Since the schema already documents parameters well, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 states the tool's purpose as 'Generate comprehensive penetration test report', which is clear but somewhat vague. It specifies the verb 'generate' and resource 'penetration test report', but lacks specificity about what makes it 'comprehensive' or how it differs from other reporting tools in the sibling list (e.g., burp_export). It's not tautological but doesn't fully distinguish from potential alternatives.

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. With multiple sibling tools like burp_export and suggest_next_steps that might involve reporting, there's no indication of context, prerequisites, or exclusions. The agent must infer usage based on the name alone, which is insufficient for optimal 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/adriyansyah-mf/mcp-pentest'

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