konsulto_list_scope
List the scope elements for an audit to confirm which targets are authorized for testing. Defaults to the active audit.
Instructions
List the scope elements for an audit — what's authorized to be tested. Use to confirm targets are in-scope before recording findings against them. Defaults to the active audit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audit | No | Audit ID. Defaults to active audit. |
Implementation Reference
- src/server.ts:805-831 (handler)The 'konsulto_list_scope' tool is defined as an MCP tool using server.tool(). It accepts an optional 'audit' string parameter (zod-validated). The handler resolves the audit ID, calls the API to fetch scopes from /audits/{auditId}/scopes, maps the response to id/name/description/type, and returns the result. Errors are caught and returned via errResult().
server.tool( 'konsulto_list_scope', 'List the scope elements for an audit — what\'s authorized to be tested. ' + 'Use to confirm targets are in-scope before recording findings against ' + 'them. Defaults to the active audit.', { audit: z.string().optional().describe('Audit ID. Defaults to active audit.'), }, async ({ audit }) => { try { const auditId = state.resolveAuditId(audit); const scopes = (await client.get<any>(`/audits/${auditId}/scopes`)) as any; const items = Array.isArray(scopes) ? scopes : (scopes?.items ?? scopes?.data ?? []); return ok({ auditId, scopes: items.map((s: any) => ({ id: String(s._id ?? s.id), name: s.name, description: s.description, type: s.type ?? s.scopeType, })), }); } catch (err) { return errResult(err); } }, ); - src/server.ts:810-812 (schema)Zod schema for the input parameter: 'audit' is an optional string describing the audit ID, defaulting to the active audit.
{ audit: z.string().optional().describe('Audit ID. Defaults to active audit.'), }, - src/server.ts:805-831 (registration)The tool is registered via server.tool() with the name 'konsulto_list_scope', a description string, the input schema, and the handler function.
server.tool( 'konsulto_list_scope', 'List the scope elements for an audit — what\'s authorized to be tested. ' + 'Use to confirm targets are in-scope before recording findings against ' + 'them. Defaults to the active audit.', { audit: z.string().optional().describe('Audit ID. Defaults to active audit.'), }, async ({ audit }) => { try { const auditId = state.resolveAuditId(audit); const scopes = (await client.get<any>(`/audits/${auditId}/scopes`)) as any; const items = Array.isArray(scopes) ? scopes : (scopes?.items ?? scopes?.data ?? []); return ok({ auditId, scopes: items.map((s: any) => ({ id: String(s._id ?? s.id), name: s.name, description: s.description, type: s.type ?? s.scopeType, })), }); } catch (err) { return errResult(err); } }, );