konsulto_search_templates
Search the finding-template catalog using text and severity filters. Returns key fields to choose a template before composing a finding.
Instructions
Search the finding-template catalog. Returns a slim shape (id, title, severity, summary, slot names, taxonomy) — NOT the full template body. Use this to pick a template before calling konsulto_compose_finding. When multiple candidates match, prefer the one whose summary best fits the evidence in hand.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Free-text search across title and aliases. | |
| severity | No | ||
| limit | No |
Implementation Reference
- src/server.ts:263-278 (handler)Handler function for konsulto_search_templates. Calls GET /finding-templates with optional search query, severity filter, and limit. Returns slim template objects (id, title, severity, summary, slot names, taxonomy).
async ({ q, severity, limit }) => { try { const params: Record<string, string> = { slim: '1', page: '1', limit: String(limit ?? 10), }; if (q) params.search = q; if (severity) params.severity = severity; const data = (await client.get<any>('/finding-templates', { params })) as any; const items = data?.items ?? data?.data ?? data ?? []; return ok({ templates: items }); } catch (err) { return errResult(err); } }, - src/server.ts:249-279 (registration)Tool registration for konsulto_search_templates with description and Zod schema for parameters: q (optional string), severity (optional enum), limit (optional number 1-50, default 10).
server.tool( 'konsulto_search_templates', 'Search the finding-template catalog. Returns a slim shape (id, title, ' + 'severity, summary, slot names, taxonomy) — NOT the full template body. ' + 'Use this to pick a template before calling konsulto_compose_finding. ' + 'When multiple candidates match, prefer the one whose summary best fits ' + 'the evidence in hand.', { q: z.string().optional().describe('Free-text search across title and aliases.'), severity: z .enum(['critical', 'high', 'medium', 'low', 'informative']) .optional(), limit: z.number().int().min(1).max(50).default(10).optional(), }, async ({ q, severity, limit }) => { try { const params: Record<string, string> = { slim: '1', page: '1', limit: String(limit ?? 10), }; if (q) params.search = q; if (severity) params.severity = severity; const data = (await client.get<any>('/finding-templates', { params })) as any; const items = data?.items ?? data?.data ?? data ?? []; return ok({ templates: items }); } catch (err) { return errResult(err); } }, ); - src/server.ts:256-262 (schema)Input schema for konsulto_search_templates: q (free-text search), severity (critical/high/medium/low/informative), limit (1-50, default 10).
{ q: z.string().optional().describe('Free-text search across title and aliases.'), severity: z .enum(['critical', 'high', 'medium', 'low', 'informative']) .optional(), limit: z.number().int().min(1).max(50).default(10).optional(), }, - src/server.ts:1008-1012 (helper)Helper function ok() used to format successful tool responses as JSON text content.
function ok(payload: unknown) { return { content: [{ type: 'text' as const, text: JSON.stringify(payload, null, 2) }], }; } - src/server.ts:1017-1023 (helper)Helper function errResult() used to format error responses for tool handlers.
function errResult(err: unknown) { const message = err instanceof Error ? err.message : String(err); return { isError: true, content: [{ type: 'text' as const, text: `Error: ${message}` }], }; }