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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It states this is a 'Get' operation, implying read-only behavior, but doesn't specify what statistics are included, format of return data, potential side effects, or error conditions. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a simple tool and front-loads the core purpose immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has no output schema and no annotations, the description is incomplete for effective use. It doesn't explain what statistics are returned, their format, or how this differs from similar sibling tools. For a data retrieval operation in a context with multiple statistical tools, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage (empty schema). The description doesn't need to explain parameters since none exist, and it correctly doesn't mention any. This meets expectations for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get statistics about test results' clearly states the verb ('Get') and resource ('statistics about test results'), providing a basic purpose. However, it doesn't distinguish this from sibling tools like 'db.get_test_results' or 'training.stats', leaving ambiguity about what specific statistics are retrieved or how this differs from other data retrieval tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'db.get_test_results' and 'training.stats' available, there's no indication of context, prerequisites, or exclusions. This forces the agent to guess based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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