search_audits
Search completed behavioral security audits to check if a skill has been audited. Filter by verdict or minimum trust score to find audits before submitting a new one.
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
| 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-63 (handler)The core handler function for search_audits. It builds query params from optional inputs (verdict, min_score, sort, order), calls GET /api/audits/search, and returns the JSON result or an error message.
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)Zod input schema for search_audits. Defines optional filters: verdict (enum), min_score (0-100 int), sort (field enum), and order (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/index.ts:23-23 (registration)Registration call in the main entry point that wires search_audits into the MCP server.
registerSearchAudits(server); - src/tools/search-audits.ts:6-64 (registration)The registerSearchAudits function that registers the tool on the MCP server with name 'search_audits'.
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/lib/types.ts:80-80 (helper)Type alias defining SearchResponse as an array of SearchResult objects, used as the response type for the search endpoint.
export type SearchResponse = SearchResult[];