training.stats
Analyze test results and training data to identify patterns and improve vulnerability detection accuracy in bug bounty hunting.
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:217-234 (handler)The core handler function for the 'training.stats' tool. It retrieves test statistics from the database, counts the number of training data entries, and calculates the average success rate across all test categories.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:210-215 (schema)Schema definition for the 'training.stats' tool, including description and empty input schema (no parameters required).description: 'Get statistics about test results and training data', inputSchema: { type: 'object', properties: {}, }, },
- src/tools/training.ts:208-235 (registration)The server.tool() registration of the 'training.stats' tool within the registerTrainingTools function.'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)Call to registerTrainingTools(server) in the main server initialization, which includes registration of 'training.stats'.registerTrainingTools(server);