konsulto_bulk_update_status
Batch update the status of multiple security findings. Preview changes with dryRun before committing.
Instructions
Change the status of many findings at once. Use for "client confirmed the fix on all of these" or "all stale findings should be closed". Set dryRun: true first to preview affected findings before committing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| findingIds | Yes | ||
| status | Yes | ||
| dryRun | No |
Implementation Reference
- src/server.ts:521-563 (handler)The tool handler for 'konsulto_bulk_update_status'. Accepts findingIds (array of strings), status (enum with open/accepted/mitigated/closed/rejected), and optional dryRun (default false). If dryRun is true, fetches each finding to preview updates. Otherwise, POSTs to /findings/bulk-update-status endpoint with the ids and status updates.
server.tool( 'konsulto_bulk_update_status', 'Change the status of many findings at once. Use for "client confirmed ' + 'the fix on all of these" or "all stale findings should be closed". ' + 'Set dryRun: true first to preview affected findings before committing.', { findingIds: z.array(z.string()).min(1), status: z.enum(['open', 'accepted', 'mitigated', 'closed', 'rejected']), dryRun: z.boolean().optional().default(false), }, async ({ findingIds, status, dryRun }) => { try { if (dryRun) { // Pre-fetch the targets so the agent can show the user what will // change before they confirm. Backend has no native dry-run on the // bulk endpoint; this simulates it client-side. const fetched = await Promise.all( findingIds.map((id) => client.get<any>(`/findings/${id}`).catch(() => null)), ); return ok({ dryRun: true, wouldUpdate: fetched .filter((f) => f) .map((f: any) => ({ id: String(f._id ?? f.id), title: f.title, currentStatus: f.status, newStatus: status, })), message: 'Re-call with dryRun: false to apply. Show this list to the user first.', }); } const result = (await client.post<any>('/findings/bulk-update-status', { ids: findingIds, updates: { status }, })) as any; return ok({ result, count: findingIds.length, newStatus: status }); } catch (err) { return errResult(err); } }, ); - src/server.ts:526-530 (schema)Zod schema for input validation: findingIds (array of strings, min 1), status (enum: open, accepted, mitigated, closed, rejected), dryRun (optional boolean, defaults to false).
{ findingIds: z.array(z.string()).min(1), status: z.enum(['open', 'accepted', 'mitigated', 'closed', 'rejected']), dryRun: z.boolean().optional().default(false), }, - src/server.ts:521-563 (registration)Registered via server.tool() call with name 'konsulto_bulk_update_status' in the buildServer function of server.ts.
server.tool( 'konsulto_bulk_update_status', 'Change the status of many findings at once. Use for "client confirmed ' + 'the fix on all of these" or "all stale findings should be closed". ' + 'Set dryRun: true first to preview affected findings before committing.', { findingIds: z.array(z.string()).min(1), status: z.enum(['open', 'accepted', 'mitigated', 'closed', 'rejected']), dryRun: z.boolean().optional().default(false), }, async ({ findingIds, status, dryRun }) => { try { if (dryRun) { // Pre-fetch the targets so the agent can show the user what will // change before they confirm. Backend has no native dry-run on the // bulk endpoint; this simulates it client-side. const fetched = await Promise.all( findingIds.map((id) => client.get<any>(`/findings/${id}`).catch(() => null)), ); return ok({ dryRun: true, wouldUpdate: fetched .filter((f) => f) .map((f: any) => ({ id: String(f._id ?? f.id), title: f.title, currentStatus: f.status, newStatus: status, })), message: 'Re-call with dryRun: false to apply. Show this list to the user first.', }); } const result = (await client.post<any>('/findings/bulk-update-status', { ids: findingIds, updates: { status }, })) as any; return ok({ result, count: findingIds.length, newStatus: status }); } catch (err) { return errResult(err); } }, ); - src/server.ts:1008-1012 (helper)The 'ok' helper function used within the handler to format successful JSON responses for MCP tool results.
function ok(payload: unknown) { return { content: [{ type: 'text' as const, text: JSON.stringify(payload, null, 2) }], }; } - src/server.ts:1017-1023 (helper)The 'errResult' helper function used within the handler to format error responses for MCP tool results.
function errResult(err: unknown) { const message = err instanceof Error ? err.message : String(err); return { isError: true, content: [{ type: 'text' as const, text: `Error: ${message}` }], }; }