search_audits
Search completed behavioral security audits to verify skill trust scores, filter by verdict, and check audit status before submission.
Instructions
Search all completed Oathe behavioral security audits. Find which skills have been audited, filter by verdict or minimum trust score. Returns up to 100 completed audits. Use this to check if a skill has already been audited before submitting a new audit.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| verdict | No | Filter by audit verdict | |
| min_score | No | Minimum trust score (0-100) | |
| sort | No | Sort field (default: created_at) | |
| order | No | Sort order (default: DESC) |
Implementation Reference
- src/tools/search-audits.ts:37-62 (handler)The main handler function that executes the search_audits tool. It constructs query parameters from optional inputs (verdict, min_score, sort, order), calls the Oathe API endpoint /api/audits/search, and returns the results as formatted JSON or handles ApiError exceptions.async ({ verdict, min_score, sort, order }) => { const params = new URLSearchParams(); if (verdict) params.set('verdict', verdict); if (min_score !== undefined) params.set('min_score', String(min_score)); if (sort) params.set('sort', sort); if (order) params.set('order', order); const query = params.toString(); const path = query ? `/api/audits/search?${query}` : '/api/audits/search'; try { const res = await apiFetch(path); const data = (await res.json()) as SearchResponse; return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; } catch (err) { if (err instanceof ApiError) { return { content: [{ type: 'text' as const, text: err.message }], isError: true, }; } throw err; } },
- src/tools/search-audits.ts:15-35 (schema)Input schema definition using zod validation. Defines four optional parameters: verdict (enum of SAFE/CAUTION/DANGEROUS/MALICIOUS), min_score (integer 0-100), sort (enum of created_at/trust_score/skill_slug), and order (enum of ASC/DESC).inputSchema: { verdict: z .enum(['SAFE', 'CAUTION', 'DANGEROUS', 'MALICIOUS']) .optional() .describe('Filter by audit verdict'), min_score: z .number() .int() .min(0) .max(100) .optional() .describe('Minimum trust score (0-100)'), sort: z .enum(['created_at', 'trust_score', 'skill_slug']) .optional() .describe('Sort field (default: created_at)'), order: z .enum(['ASC', 'DESC']) .optional() .describe('Sort order (default: DESC)'), },
- src/tools/search-audits.ts:6-64 (registration)The registerSearchAudits function that registers the search_audits tool with the MCP server. Includes tool name, description, input schema, and the async handler function.export function registerSearchAudits(server: McpServer): void { server.registerTool( 'search_audits', { description: 'Search all completed Oathe behavioral security audits. ' + 'Find which skills have been audited, filter by verdict or minimum trust score. ' + 'Returns up to 100 completed audits. ' + 'Use this to check if a skill has already been audited before submitting a new audit.', inputSchema: { verdict: z .enum(['SAFE', 'CAUTION', 'DANGEROUS', 'MALICIOUS']) .optional() .describe('Filter by audit verdict'), min_score: z .number() .int() .min(0) .max(100) .optional() .describe('Minimum trust score (0-100)'), sort: z .enum(['created_at', 'trust_score', 'skill_slug']) .optional() .describe('Sort field (default: created_at)'), order: z .enum(['ASC', 'DESC']) .optional() .describe('Sort order (default: DESC)'), }, }, async ({ verdict, min_score, sort, order }) => { const params = new URLSearchParams(); if (verdict) params.set('verdict', verdict); if (min_score !== undefined) params.set('min_score', String(min_score)); if (sort) params.set('sort', sort); if (order) params.set('order', order); const query = params.toString(); const path = query ? `/api/audits/search?${query}` : '/api/audits/search'; try { const res = await apiFetch(path); const data = (await res.json()) as SearchResponse; return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; } catch (err) { if (err instanceof ApiError) { return { content: [{ type: 'text' as const, text: err.message }], isError: true, }; } throw err; } }, ); }
- src/index.ts:8-23 (registration)Import and registration of search_audits in the main server initialization. Line 8 imports registerSearchAudits and line 23 calls it to register the tool with the MCP server instance.import { registerSearchAudits } from './tools/search-audits.js'; const server = new McpServer({ name: 'oathe-mcp', version: '0.1.1', description: 'Security scanner for AI agent skills. Before installing any third-party ' + 'MCP server, plugin, or tool, check it with Oathe first. Returns trust ' + 'scores, verdicts, and detailed findings. Free, no API key required.', }); registerSubmitAudit(server); registerCheckStatus(server); registerGetReport(server); registerGetSummary(server); registerSearchAudits(server);
- src/lib/types.ts:65-80 (schema)Type definitions for the search_audits response. Defines SearchResult interface (audit_id, skill_url, skill_slug, trust_score, verdict, status, completed_at, stale) and SearchResponse as an array of SearchResult objects.export interface SearchResult { audit_id: string; skill_url: string; skill_slug: string; trust_score: number; verdict: string; status: string; completed_at: string | null; stale: number; } /** * Current search response is a flat array. Phase 2D may wrap this in * `{ data: SearchResult[], pagination: { cursor, has_more } }`. */ export type SearchResponse = SearchResult[];