Skip to main content
Glama

download_report

Retrieve completed penetration test reports in markdown, JSON, or PDF formats for analysis and documentation.

Instructions

Download a pentest report. Use format=markdown for AI-readable content, format=json for structured data, or format=pdf for the full formatted report. The scan must be complete.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pentest_idYesThe pentest ID (UUID)
formatYesReport format: markdown (best for AI reading), json (structured data), pdf (formatted document)

Implementation Reference

  • The handler function for 'download_report' that calls the client's getReport method and formats the response.
    async ({ pentest_id, format }) => {
      try {
        const result = await client.getReport(pentest_id, format);
    
        if (format === "pdf") {
          return {
            content: [
              {
                type: "text" as const,
                text:
                  `PDF report for pentest ${pentest_id} is available for download at:\n` +
                  `https://turbopentest.com/api/pentests/${pentest_id}/report?format=pdf\n\n` +
                  "Note: PDF content cannot be displayed inline. Use format=markdown for AI-readable content.",
              },
            ],
          };
        }
    
        if (format === "json") {
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        }
    
        // markdown
        return {
          content: [{ type: "text" as const, text: result as string }],
        };
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return {
          content: [{ type: "text" as const, text: `Failed to download report: ${message}` }],
          isError: true,
        };
      }
    },
  • Input schema definition for the 'download_report' tool using Zod.
    inputSchema: z.object({
      pentest_id: z.string().uuid().describe("The pentest ID (UUID)"),
      format: z
        .enum(["json", "markdown", "pdf"])
        .describe(
          "Report format: markdown (best for AI reading), json (structured data), pdf (formatted document)",
        ),
    }),
  • Registration function for the 'download_report' tool.
    export function registerDownloadReport(server: McpServer, client: TurboPentestClient): void {
      server.registerTool(
        "download_report",
        {
          title: "Download Report",
          description:
            "Download a pentest report. Use format=markdown for AI-readable content, " +
            "format=json for structured data, or format=pdf for the full formatted report. " +
            "The scan must be complete.",
          inputSchema: z.object({
            pentest_id: z.string().uuid().describe("The pentest ID (UUID)"),
            format: z
              .enum(["json", "markdown", "pdf"])
              .describe(
                "Report format: markdown (best for AI reading), json (structured data), pdf (formatted document)",
              ),
          }),
        },
        async ({ pentest_id, format }) => {
          try {
            const result = await client.getReport(pentest_id, format);
    
            if (format === "pdf") {
              return {
                content: [
                  {
                    type: "text" as const,
                    text:
                      `PDF report for pentest ${pentest_id} is available for download at:\n` +
                      `https://turbopentest.com/api/pentests/${pentest_id}/report?format=pdf\n\n` +
                      "Note: PDF content cannot be displayed inline. Use format=markdown for AI-readable content.",
                  },
                ],
              };
            }
    
            if (format === "json") {
              return {
                content: [
                  {
                    type: "text" as const,
                    text: JSON.stringify(result, null, 2),
                  },
                ],
              };
            }
    
            // markdown
            return {
              content: [{ type: "text" as const, text: result as string }],
            };
          } catch (error) {
            const message = error instanceof Error ? error.message : String(error);
            return {
              content: [{ type: "text" as const, text: `Failed to download report: ${message}` }],
              isError: true,
            };
          }
        },
      );

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