Skip to main content
Glama

db.get_test_results

Retrieve vulnerability test results with filtering by target, test type, and success status to analyze security assessments from bug bounty hunting tools.

Instructions

Retrieve test results with success/failure and scores

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNoFilter by target
testTypeNoFilter by test type
successNoFilter by success status
limitNoMaximum number of results

Implementation Reference

  • Executes the tool logic: fetches test results via helper, computes aggregate stats (count, success/failure counts, avg score), formats ToolResult.
    async ({ target, testType, success, limit = 100 }: any): Promise<ToolResult> => {
      try {
        const results = await getTestResults(target, testType, success, limit);
        return formatToolResult(true, {
          testResults: results,
          count: results.length,
          successCount: results.filter((r: any) => r.success).length,
          failureCount: results.filter((r: any) => !r.success).length,
          avgScore: results.reduce((sum: number, r: any) => sum + (r.score || 0), 0) / results.length || 0,
        });
      } catch (error: any) {
        return formatToolResult(false, null, error.message);
      }
    }
  • Input schema defining optional filters for target, testType, success status, and result limit.
      description: 'Retrieve test results with success/failure and scores',
      inputSchema: {
        type: 'object',
        properties: {
          target: { type: 'string', description: 'Filter by target' },
          testType: { type: 'string', description: 'Filter by test type' },
          success: { type: 'boolean', description: 'Filter by success status' },
          limit: { type: 'number', description: 'Maximum number of results', default: 100 },
        },
      },
    },
  • Registers the db.get_test_results MCP tool with MCP Server instance, providing description, input schema, and handler.
    server.tool(
      'db.get_test_results',
      {
        description: 'Retrieve test results with success/failure and scores',
        inputSchema: {
          type: 'object',
          properties: {
            target: { type: 'string', description: 'Filter by target' },
            testType: { type: 'string', description: 'Filter by test type' },
            success: { type: 'boolean', description: 'Filter by success status' },
            limit: { type: 'number', description: 'Maximum number of results', default: 100 },
          },
        },
      },
      async ({ target, testType, success, limit = 100 }: any): Promise<ToolResult> => {
        try {
          const results = await getTestResults(target, testType, success, limit);
          return formatToolResult(true, {
            testResults: results,
            count: results.length,
            successCount: results.filter((r: any) => r.success).length,
            failureCount: results.filter((r: any) => !r.success).length,
            avgScore: results.reduce((sum: number, r: any) => sum + (r.score || 0), 0) / results.length || 0,
          });
        } catch (error: any) {
          return formatToolResult(false, null, error.message);
        }
      }
    );
  • Supporting function that builds and executes dynamic SQL query on test_results table with filters for target, testType, success; returns raw rows.
    export async function getTestResults(
      target?: string,
      testType?: string,
      success?: boolean,
      limit: number = 100
    ): Promise<any[]> {
      const client = await initPostgres().connect();
      try {
        let query = 'SELECT * FROM test_results';
        const conditions: string[] = [];
        const params: any[] = [];
        let paramCount = 0;
    
        if (target) {
          paramCount++;
          conditions.push(`target = $${paramCount}`);
          params.push(target);
        }
        if (testType) {
          paramCount++;
          conditions.push(`test_type = $${paramCount}`);
          params.push(testType);
        }
        if (success !== undefined) {
          paramCount++;
          conditions.push(`success = $${paramCount}`);
          params.push(success);
        }
    
        if (conditions.length > 0) {
          query += ' WHERE ' + conditions.join(' AND ');
        }
    
        query += ' ORDER BY timestamp DESC LIMIT $' + (paramCount + 1);
        params.push(limit);
    
        const result: QueryResult = await client.query(query, params);
        return result.rows;
      } finally {
        client.release();
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but lacks behavioral details. It doesn't disclose if this is a read-only operation, requires authentication, has rate limits, returns paginated results, or what happens with no filters. 'Retrieve' implies reading, but specifics are missing.

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 front-loads the core purpose ('Retrieve test results') and adds key details ('with success/failure and scores') concisely.

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

Completeness3/5

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

For a read operation with 4 parameters and 100% schema coverage but no output schema or annotations, the description is minimally adequate. It states what is retrieved but lacks context on behavior, output format, or usage scenarios, leaving gaps for an AI agent.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds no parameter-specific information beyond implying filtering by success/failure and scores, which is already covered in the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Retrieve') and resource ('test results'), specifying they include 'success/failure and scores'. It distinguishes from siblings like 'db.get_findings' or 'db.get_statistics' by focusing on test results, though it doesn't explicitly contrast them.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, context (e.g., after running tests), or comparisons to siblings like 'db.get_findings' for different data types.

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