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
| Name | Required | Description | Default |
|---|---|---|---|
| pentest_id | Yes | The pentest ID (UUID) | |
| format | Yes | Report format: markdown (best for AI reading), json (structured data), pdf (formatted document) |
Implementation Reference
- src/tools/download-report.ts:23-63 (handler)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, }; } }, - src/tools/download-report.ts:14-21 (schema)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)", ), }), - src/tools/download-report.ts:5-64 (registration)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, }; } }, );