Skip to main content
Glama

db.get_statistics

Retrieve test result statistics from the VulneraMCP security platform to analyze vulnerability findings and track bug bounty program performance.

Instructions

Get statistics about test results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the db.get_statistics tool logic: calls getTestStatistics(), computes summary statistics, and formats the result.
    async (): Promise<ToolResult> => { try { const stats = await getTestStatistics(); return formatToolResult(true, { statistics: stats, summary: { totalTests: stats.reduce((sum: number, s: any) => sum + parseInt(s.count || 0), 0), totalTypes: stats.length, }, }); } catch (error: any) { return formatToolResult(false, null, error.message); } }
  • Registers the db.get_statistics tool on the MCP server within registerDatabaseTools, including name, description, input schema (empty), and handler.
    server.tool( 'db.get_statistics', { description: 'Get statistics about test results', inputSchema: { type: 'object', properties: {}, }, }, async (): Promise<ToolResult> => { try { const stats = await getTestStatistics(); return formatToolResult(true, { statistics: stats, summary: { totalTests: stats.reduce((sum: number, s: any) => sum + parseInt(s.count || 0), 0), totalTypes: stats.length, }, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );
  • Input schema for db.get_statistics: takes no parameters (empty properties).
    { description: 'Get statistics about test results', inputSchema: { type: 'object', properties: {}, }, },
  • Helper function getTestStatistics that performs the SQL query to retrieve test statistics grouped by test_type from the test_results table.
    export async function getTestStatistics(): Promise<any> { const client = await initPostgres().connect(); try { const stats = await client.query(` SELECT COUNT(*) as total_tests, COUNT(*) FILTER (WHERE success = true) as successful_tests, COUNT(*) FILTER (WHERE success = false) as failed_tests, AVG(score) as avg_score, test_type, COUNT(*) as count FROM test_results GROUP BY test_type ORDER BY count DESC `); return stats.rows; } finally { client.release(); } }
  • src/index.ts:46-46 (registration)
    Top-level call to registerDatabaseTools(server) which registers all db.* tools including db.get_statistics.
    registerDatabaseTools(server);

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/telmon95/VulneraMCP'

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