db.get_findings
Retrieve bug bounty findings from the database to analyze vulnerabilities, filter by target, and manage security testing results.
Instructions
Retrieve bug findings from the database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Filter by target | |
| limit | No | Maximum number of results |
Implementation Reference
- src/tools/database.ts:58-81 (registration)Registration of the 'db.get_findings' MCP tool, including input schema and inline handler function that delegates to getFindings helper.server.tool( 'db.get_findings', { description: 'Retrieve bug findings from the database', inputSchema: { type: 'object', properties: { target: { type: 'string', description: 'Filter by target' }, limit: { type: 'number', description: 'Maximum number of results', default: 100 }, }, }, }, async ({ target, limit = 100 }: any): Promise<ToolResult> => { try { const findings = await getFindings(target, limit); return formatToolResult(true, { findings, count: findings.length, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );
- src/tools/database.ts:70-80 (handler)Inline handler function for the db.get_findings tool that fetches findings from database helper and returns formatted ToolResult.async ({ target, limit = 100 }: any): Promise<ToolResult> => { try { const findings = await getFindings(target, limit); return formatToolResult(true, { findings, count: findings.length, }); } catch (error: any) { return formatToolResult(false, null, error.message); } }
- src/tools/database.ts:62-68 (schema)Input schema for the db.get_findings tool defining parameters target and limit.inputSchema: { type: 'object', properties: { target: { type: 'string', description: 'Filter by target' }, limit: { type: 'number', description: 'Maximum number of results', default: 100 }, }, },
- src/integrations/postgres.ts:119-151 (helper)Database helper function getFindings that executes SQL query to retrieve findings from PostgreSQL findings table.export async function getFindings( target?: string, limit: number = 100 ): Promise<Finding[]> { const client = await initPostgres().connect(); try { let query = 'SELECT * FROM findings'; const params: any[] = []; if (target) { query += ' WHERE target = $1'; params.push(target); } query += ' ORDER BY timestamp DESC LIMIT $' + (params.length + 1); params.push(limit); const result: QueryResult = await client.query(query, params); return result.rows.map((row: any) => ({ id: row.id.toString(), target: row.target, type: row.type, severity: row.severity, description: row.description, payload: row.payload, response: row.response, timestamp: row.timestamp, score: row.score, })); } finally { client.release(); } }