get_site_map
Retrieve and analyze the site structure identified during scanning and browsing. Filter by host, URLs with parameters, and limit results.
Instructions
Get the site structure discovered during scanning and browsing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Filter by host (optional) | |
| limit | No | Maximum number of items to return (default: 20) | |
| with_parameters | No | Only show URLs with parameters (optional) |
Implementation Reference
- src/index.ts:637-665 (handler)Handler for the 'get_site_map' tool. Filters the mock site map data by host, whether to include only items with parameters, and limit, then returns a JSON summary of the filtered items.case "get_site_map": { const host = request.params.arguments?.host as string | undefined; const withParameters = request.params.arguments?.with_parameters as boolean | undefined; const limit = Number(request.params.arguments?.limit || 20); let siteMap = [...mockSiteMap]; // Apply filters if (host) { siteMap = siteMap.filter(item => new URL(item.url).hostname.includes(host)); } if (withParameters) { siteMap = siteMap.filter(item => item.parameters); } // Apply limit siteMap = siteMap.slice(0, limit); return { content: [{ type: "text", text: JSON.stringify({ total_items: siteMap.length, items: siteMap }, null, 2) }] }; }
- src/index.ts:459-479 (registration)Registration of the 'get_site_map' tool in the listTools handler, including name, description, and input schema.{ name: "get_site_map", description: "Get the site structure discovered during scanning and browsing", inputSchema: { type: "object", properties: { host: { type: "string", description: "Filter by host (optional)" }, with_parameters: { type: "boolean", description: "Only show URLs with parameters (optional)" }, limit: { type: "number", description: "Maximum number of items to return (default: 20)" } } } }
- src/index.ts:75-83 (schema)TypeScript interface defining the structure of SiteMapItem used by the get_site_map tool.interface SiteMapItem { id: string; url: string; method: string; statusCode: number; mimeType: string; size: number; parameters: boolean; }
- src/index.ts:114-151 (helper)Mock site map data array used as the data source for the get_site_map tool implementation.const mockSiteMap: SiteMapItem[] = [ { id: "1", url: "https://example.com/", method: "GET", statusCode: 200, mimeType: "text/html", size: 1256, parameters: false }, { id: "2", url: "https://example.com/assets/style.css", method: "GET", statusCode: 200, mimeType: "text/css", size: 128, parameters: false }, { id: "3", url: "https://example.com/login", method: "GET", statusCode: 200, mimeType: "text/html", size: 2048, parameters: false }, { id: "4", url: "https://example.com/api/user", method: "POST", statusCode: 200, mimeType: "application/json", size: 512, parameters: true } ];