Skip to main content
Glama

Get Pentest

get_pentest

Retrieve comprehensive penetration test details including status, findings summary, executive overview, attack surface map, and STRIDE threat model analysis.

Instructions

Get full details for a pentest including status, progress, findings summary, executive summary, attack surface map, and STRIDE threat model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pentest_idYesThe pentest ID (UUID)

Implementation Reference

  • The handler function for the get_pentest tool, which fetches pentest details from the client and formats them into a readable string.
    async ({ pentest_id }) => {
      try {
        const scan = await client.getPentest(pentest_id);
    
        const severityCounts: Record<string, number> = {
          critical: 0,
          high: 0,
          medium: 0,
          low: 0,
          info: 0,
        };
        for (const f of scan.findings ?? []) {
          severityCounts[f.severity] = (severityCounts[f.severity] || 0) + 1;
        }
    
        const toolResults = scan.toolResults ?? [];
        const toolsDone = toolResults.filter((t) => t.status === "complete").length;
        const toolsTotal = toolResults.length;
        const progress = toolsTotal > 0 ? Math.round((toolsDone / toolsTotal) * 100) : 0;
    
        const lines: string[] = [
          `Pentest: ${scan.id}`,
          `Target:  ${scan.targetUrl}`,
          `Status:  ${scan.status}`,
        ];
    
        if (scan.status === "scanning") {
          lines.push(`Progress: ${progress}% (${toolsDone}/${toolsTotal} tools complete)`);
        }
    
        lines.push(
          `Started: ${scan.startedAt || "pending"}`,
          scan.completedAt ? `Completed: ${scan.completedAt}` : "",
          "",
          `--- Findings (${(scan.findings ?? []).length} total) ---`,
          `  Critical: ${severityCounts.critical}`,
          `  High:     ${severityCounts.high}`,
          `  Medium:   ${severityCounts.medium}`,
          `  Low:      ${severityCounts.low}`,
          `  Info:     ${severityCounts.info}`,
        );
    
        if (scan.status === "scanning") {
          const running = toolResults.filter((t) => t.status === "running").map((t) => t.toolName);
          const pending = toolResults.filter((t) => t.status === "pending").map((t) => t.toolName);
          if (running.length) lines.push("", `Running: ${running.join(", ")}`);
          if (pending.length) lines.push(`Pending: ${pending.join(", ")}`);
        }
    
        if (scan.executiveSummary) {
          lines.push("", "--- Executive Summary ---", scan.executiveSummary);
        }
    
        if (scan.attackSurface) {
          lines.push("", "--- Attack Surface ---", JSON.stringify(scan.attackSurface, null, 2));
        }
    
        if (scan.threatModel) {
          lines.push("", "--- STRIDE Threat Model ---", JSON.stringify(scan.threatModel, null, 2));
        }
    
        if (scan.failureReason) {
          lines.push("", `Failure reason: ${scan.failureReason}`);
        }
    
        return {
          content: [{ type: "text" as const, text: lines.filter((l) => l !== "").join("\n") }],
        };
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: "text" as const, text: `Failed to get pentest: ${message}` }],
          isError: true,
        };
      }
    },
  • The input schema defined using Zod, expecting a pentest_id as a UUID.
    inputSchema: z.object({
      pentest_id: z.string().uuid().describe("The pentest ID (UUID)"),
    }),
  • The registration function that defines the 'get_pentest' tool in the McpServer.
    export function registerGetPentest(server: McpServer, client: TurboPentestClient): void {
      server.registerTool(
        "get_pentest",
        {
          title: "Get Pentest",
          description:
            "Get full details for a pentest including status, progress, findings summary, " +
            "executive summary, attack surface map, and STRIDE threat model.",
          inputSchema: z.object({
            pentest_id: z.string().uuid().describe("The pentest ID (UUID)"),
          }),
        },
        async ({ pentest_id }) => {
          try {
            const scan = await client.getPentest(pentest_id);
    
            const severityCounts: Record<string, number> = {
              critical: 0,
              high: 0,
              medium: 0,
              low: 0,
              info: 0,
            };
            for (const f of scan.findings ?? []) {
              severityCounts[f.severity] = (severityCounts[f.severity] || 0) + 1;
            }
    
            const toolResults = scan.toolResults ?? [];
            const toolsDone = toolResults.filter((t) => t.status === "complete").length;
            const toolsTotal = toolResults.length;
            const progress = toolsTotal > 0 ? Math.round((toolsDone / toolsTotal) * 100) : 0;
    
            const lines: string[] = [
              `Pentest: ${scan.id}`,
              `Target:  ${scan.targetUrl}`,
              `Status:  ${scan.status}`,
            ];
    
            if (scan.status === "scanning") {
              lines.push(`Progress: ${progress}% (${toolsDone}/${toolsTotal} tools complete)`);
            }
    
            lines.push(
              `Started: ${scan.startedAt || "pending"}`,
              scan.completedAt ? `Completed: ${scan.completedAt}` : "",
              "",
              `--- Findings (${(scan.findings ?? []).length} total) ---`,
              `  Critical: ${severityCounts.critical}`,
              `  High:     ${severityCounts.high}`,
              `  Medium:   ${severityCounts.medium}`,
              `  Low:      ${severityCounts.low}`,
              `  Info:     ${severityCounts.info}`,
            );
    
            if (scan.status === "scanning") {
              const running = toolResults.filter((t) => t.status === "running").map((t) => t.toolName);
              const pending = toolResults.filter((t) => t.status === "pending").map((t) => t.toolName);
              if (running.length) lines.push("", `Running: ${running.join(", ")}`);
              if (pending.length) lines.push(`Pending: ${pending.join(", ")}`);
            }
    
            if (scan.executiveSummary) {
              lines.push("", "--- Executive Summary ---", scan.executiveSummary);
            }
    
            if (scan.attackSurface) {
              lines.push("", "--- Attack Surface ---", JSON.stringify(scan.attackSurface, null, 2));
            }
    
            if (scan.threatModel) {
              lines.push("", "--- STRIDE Threat Model ---", JSON.stringify(scan.threatModel, null, 2));
            }
    
            if (scan.failureReason) {
              lines.push("", `Failure reason: ${scan.failureReason}`);
            }
    
            return {
              content: [{ type: "text" as const, text: lines.filter((l) => l !== "").join("\n") }],
            };
          } catch (error) {
            const message = error instanceof Error ? error.message : String(error);
            return {
              content: [{ type: "text" as const, text: `Failed to get pentest: ${message}` }],
              isError: true,
            };
          }
        },
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It describes what details are returned but doesn't disclose behavioral traits like whether this is a read-only operation, authentication requirements, rate limits, error conditions, or pagination. For a tool with no annotations, this leaves significant gaps in understanding how it behaves.

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 that front-loads the purpose and lists included details. Every word earns its place with no redundancy or fluff, making it easy for an agent 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 no annotations and no output schema, the description is incomplete. It lists return details but doesn't explain the structure, format, or potential errors. For a tool that returns complex data (e.g., executive summary, threat model), more context is needed to help the agent use it effectively.

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%, with the parameter 'pentest_id' clearly documented as a UUID in the schema. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain where to get the pentest_id from or format nuances). 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 verb 'Get' and resource 'pentest' with specific details included (status, progress, findings summary, etc.). It distinguishes from siblings like 'list_pentests' (which likely lists multiple pentests) and 'get_findings' (which likely focuses only on findings). However, it doesn't explicitly contrast with all siblings, so it's not a perfect 5.

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 like 'list_pentests' or 'get_findings'. It doesn't mention prerequisites (e.g., needing a pentest ID) or context for usage. The agent must infer usage from the tool name and parameter alone.

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/IntegSec/turbopentest-mcp'

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