Skip to main content
Glama

zap.get_urls

Extract discovered URLs from OWASP ZAP security scans to analyze web application attack surfaces and identify potential vulnerabilities.

Instructions

Get list of discovered URLs from ZAP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseURLNoFilter by base URL (optional)

Implementation Reference

  • Registration of the 'zap.get_urls' MCP tool, including input schema and handler function that delegates to ZAPClient.getUrls
    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); } );
  • Core handler implementation in ZAPClient class that fetches discovered URLs via ZAP REST API /core/view/urls/ endpoint
    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', }; } }
  • Helper function to retrieve the singleton ZAPClient instance used by the tool handler
    export function getZAPClient(): ZAPClient | null { return zapClient; }
  • Initialization function for creating the singleton ZAPClient instance called during tool registration
    export function initZAP(baseURL?: string, apiKey?: string): ZAPClient { if (!zapClient) { zapClient = new ZAPClient( baseURL || process.env.ZAP_URL || 'http://localhost:8081', apiKey || process.env.ZAP_API_KEY ); } return zapClient; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/telmon95/VulneraMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server