zap.get_urls
Retrieve discovered URLs from ZAP security scans to analyze web application attack surfaces and identify potential entry points for vulnerability testing.
Instructions
Get list of discovered URLs from ZAP
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| baseURL | No | Filter by base URL (optional) |
Implementation Reference
- src/tools/zap.ts:416-423 (handler)MCP tool handler for 'zap.get_urls'. Retrieves the ZAPClient instance and invokes its getUrls method, formatting the result using formatToolResult.async ({ baseURL }: any): Promise<ToolResult> => { const client = getZAPClient(); if (!client) { return formatToolResult(false, null, 'ZAP client not initialized'); } const result = await client.getUrls(baseURL); return formatToolResult(result.success, result.data, result.error); }
- src/tools/zap.ts:404-414 (schema)Input schema definition for the 'zap.get_urls' tool, specifying an optional baseURL parameter.{ description: 'Get list of discovered URLs from ZAP', inputSchema: { type: 'object', properties: { baseURL: { type: 'string', description: 'Filter by base URL (optional)', }, }, },
- src/tools/zap.ts:402-424 (registration)Full registration of the 'zap.get_urls' MCP tool via server.tool(), including name, schema, and handler function.server.tool( 'zap.get_urls', { description: 'Get list of discovered URLs from ZAP', inputSchema: { type: 'object', properties: { baseURL: { type: 'string', description: 'Filter by base URL (optional)', }, }, }, }, async ({ baseURL }: any): Promise<ToolResult> => { const client = getZAPClient(); if (!client) { return formatToolResult(false, null, 'ZAP client not initialized'); } const result = await client.getUrls(baseURL); return formatToolResult(result.success, result.data, result.error); } );
- src/integrations/zap.ts:432-450 (helper)Core helper method in ZAPClient class that fetches the list of URLs from ZAP's REST API endpoint '/core/view/urls/', optionally filtered by baseURL.async getUrls(baseURL?: string): Promise<ZAPScanResult> { try { const params: any = {}; if (baseURL) params.baseurl = baseURL; const response = await this.client.get('/core/view/urls/', { params }); return { success: true, data: { urls: response.data.urls || [], }, }; } catch (error: any) { return { success: false, error: error.message || 'Failed to get URLs', }; } }