training.stats
Analyze test results and training data statistics to track vulnerability assessment progress and identify patterns in security testing.
Instructions
Get statistics about test results and training data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/training.ts:216-233 (handler)The handler function that executes the 'training.stats' tool. It retrieves test statistics using getTestStatistics(), counts training data entries, and calculates the average success rate across stats.async (): Promise<ToolResult> => { try { const stats = await getTestStatistics(); const trainingCount = await getTrainingData(undefined, undefined, 1000); return formatToolResult(true, { testStatistics: stats, trainingDataCount: trainingCount.length, successRate: stats.reduce((acc: number, stat: any) => { const total = parseInt(stat.total_tests) || 0; const success = parseInt(stat.successful_tests) || 0; return total > 0 ? (success / total) * 100 : 0; }, 0) / stats.length, }); } catch (error: any) { return formatToolResult(false, null, error.message); } }
- src/tools/training.ts:207-234 (registration)Direct registration of the 'training.stats' tool within the registerTrainingTools function using server.tool(). Includes inline schema (empty input) and handler.server.tool( 'training.stats', { description: 'Get statistics about test results and training data', inputSchema: { type: 'object', properties: {}, }, }, async (): Promise<ToolResult> => { try { const stats = await getTestStatistics(); const trainingCount = await getTrainingData(undefined, undefined, 1000); return formatToolResult(true, { testStatistics: stats, trainingDataCount: trainingCount.length, successRate: stats.reduce((acc: number, stat: any) => { const total = parseInt(stat.total_tests) || 0; const success = parseInt(stat.successful_tests) || 0; return total > 0 ? (success / total) * 100 : 0; }, 0) / stats.length, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );
- src/index.ts:47-47 (registration)Top-level registration call to registerTrainingTools(server), which includes the 'training.stats' tool registration.registerTrainingTools(server);
- src/index.ts:23-23 (registration)Import of registerTrainingTools function used to register training tools including 'training.stats'.import { registerTrainingTools } from './tools/training';