Skip to main content
Glama

createClientReport

Generate comprehensive penetration testing reports by compiling scan results, executive summaries, and security recommendations for client assessments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientYesClient name for the report
titleYesTitle of the assessment report
assessmentTypeYesType of assessment
scanIdsYesIDs of scans to include
summaryNoExecutive summary
recommendationsNoList of recommendations

Implementation Reference

  • Zod schema defining the input parameters for the createClientReport tool, including client details, scan IDs, and optional summary/recommendations.
    const createClientReportToolSchema = z.object({
      client: z.string().describe("Client name for the report"),
      title: z.string().describe("Title of the assessment report"),
      assessmentType: z.string().describe("Type of assessment"),
      scanIds: z.array(z.string()).describe("IDs of scans to include"),
      summary: z.string().optional().describe("Executive summary"),
      recommendations: z.array(z.string()).optional().describe("List of recommendations")
    }).describe(
      "Create a summarized client report from completed scans. Include scanIds returned from tools like `nmapScan`."
    );
    server.tool("createClientReport", createClientReportToolSchema.shape, async (args /*: z.infer<typeof createClientReportToolSchema> */ /*, extra */) => {
  • src/index.ts:1076-1088 (registration)
    Registers the createClientReport tool with MCP server using server.tool(), including the inline handler function.
      const { client, title, assessmentType, scanIds, summary, recommendations } = args;
      const reportId = `report-${Date.now()}`;
      const scans = scanIds.map(getScanDataById).filter(Boolean);
      const findings = analyzeFindings(scans);
      const report: ClientReport = {
        reportId, title, client, createdAt: Date.now(),
        assessmentType, findings, scans,
        summary: summary || "", recommendations: recommendations || []
      };
      clientReports.set(reportId, report);
      return { content: [ { type: "text", text: `Client report created: ${reportId}` }, { type: "text", text: `URI: mcp://pentest/clientReport/${reportId}` } ] };
    });
  • The core handler logic for createClientReport: generates unique report ID, retrieves scans by ID, analyzes findings by severity, constructs ClientReport object, stores in memory map, and returns confirmation with resource URI.
      const { client, title, assessmentType, scanIds, summary, recommendations } = args;
      const reportId = `report-${Date.now()}`;
      const scans = scanIds.map(getScanDataById).filter(Boolean);
      const findings = analyzeFindings(scans);
      const report: ClientReport = {
        reportId, title, client, createdAt: Date.now(),
        assessmentType, findings, scans,
        summary: summary || "", recommendations: recommendations || []
      };
      clientReports.set(reportId, report);
      return { content: [ { type: "text", text: `Client report created: ${reportId}` }, { type: "text", text: `URI: mcp://pentest/clientReport/${reportId}` } ] };
    });
  • Helper function analyzeFindings categorizes open ports from Nmap scans into severity levels based on common vulnerable ports (critical: RDP/Postgres/SQL/FTP/Telnet; high: SSH/SMB; etc.). Used by the tool handler.
    function analyzeFindings(scans: any[]): {
      critical: Finding[];
      high: Finding[];
      medium: Finding[];
      low: Finding[];
      info: Finding[];
    } {
      const findings: {
        critical: Finding[];
        high: Finding[];
        medium: Finding[];
        low: Finding[];
        info: Finding[];
      } = {
        critical: [],
        high: [],
        medium: [],
        low: [],
        info: []
      };
      for (const scan of scans) {
        if (!scan || !scan.results) continue;
        for (const ip in scan.results) {
          const host = scan.results[ip] as Host;
          if (!host.ports) continue;
          for (const port of host.ports) {
            if (port.state === 'open') {
              const finding: Finding = {
                host: ip,
                port: port.portId,
                service: port.service?.name || 'unknown',
                description: `Open port ${port.portId} (${port.service?.name || 'unknown'})`,
                details: port
              };
              if (['3389', '5432', '1433', '21', '23'].includes(port.portId)) {
                findings.critical.push(finding);
              } else if (['22', '445', '139'].includes(port.portId)) {
                findings.high.push(finding);
              } else if (['80', '443', '8080'].includes(port.portId)) {
                findings.medium.push(finding);
              } else {
                findings.low.push(finding);
              }
            }
          }
        }
      }
      return findings;
    }
  • Helper function getScanDataById retrieves scan data for a given scanId from active scans (returns partial info) or null if not active (placeholder for log retrieval). Called by handler to fetch scans.
    function getScanDataById(scanId: string): any {
      // First check active scans
      const activeScan = activeScans.get(scanId);
      if (activeScan) {
        return {
          scanId,
          target: activeScan.progress.target,
          options: [], // Would need to store this in the activeScan object
          timestamp: activeScan.progress.startTime,
          results: {} // Would need to store partial results
        };
      }
      
      // Otherwise, would need to retrieve from log file
      // This is a placeholder - real implementation would parse logs
      return null;
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

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/DMontgomery40/pentest-mcp'

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