zap.get_sites
Retrieve discovered websites from OWASP ZAP for security testing and vulnerability assessment in bug bounty hunting workflows.
Instructions
Get list of discovered sites from ZAP
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/zap.ts:391-398 (handler)MCP tool handler for 'zap.get_sites': retrieves the ZAP client instance and calls its getSites() method, handling errors and formatting the result using formatToolResult.
async (): Promise<ToolResult> => { const client = getZAPClient(); if (!client) { return formatToolResult(false, null, 'ZAP client not initialized'); } const result = await client.getSites(); return formatToolResult(result.success, result.data, result.error); } - src/integrations/zap.ts:412-427 (helper)Core helper method ZAPClient.getSites(): queries the ZAP API endpoint '/core/view/sites/' via axios to fetch discovered sites tree.
async getSites(): Promise<ZAPScanResult> { try { const response = await this.client.get('/core/view/sites/'); return { success: true, data: { sites: response.data.sites || [], }, }; } catch (error: any) { return { success: false, error: error.message || 'Failed to get sites', }; } } - src/tools/zap.ts:382-399 (registration)Registers the 'zap.get_sites' tool with the MCP server inside registerZAPTools function, providing schema and handler.
server.tool( 'zap.get_sites', { description: 'Get list of discovered sites from ZAP', inputSchema: { type: 'object', properties: {}, }, }, async (): Promise<ToolResult> => { const client = getZAPClient(); if (!client) { return formatToolResult(false, null, 'ZAP client not initialized'); } const result = await client.getSites(); return formatToolResult(result.success, result.data, result.error); } ); - src/tools/zap.ts:384-390 (schema)Input schema for 'zap.get_sites': requires no parameters (empty properties). Includes tool description.
{ description: 'Get list of discovered sites from ZAP', inputSchema: { type: 'object', properties: {}, }, },