get_domains
Retrieve captured domain names with request frequency from ProxyPin's network traffic history for analysis and API structure review.
Instructions
Get list of all captured domains with request counts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/proxypin_mcp/server.py:162-183 (handler)The `get_domains` function is the handler that retrieves and aggregates captured domains and their associated request methods and counts. It is registered as an MCP tool using the `@mcp.tool()` decorator.
@mcp.tool() def get_domains() -> str: """Get list of all captured domains with request counts.""" requests = reader.get_requests(limit=500, detail_level=DetailLevel.SUMMARY) domains: dict[str, dict[str, Any]] = {} for req in requests: if not isinstance(req, RequestSummary) or not req.host: continue entry = domains.setdefault(req.host, {"count": 0, "methods": set()}) entry["count"] += 1 entry["methods"].add(req.method) result = [ { "domain": domain, "count": info["count"], "methods": sorted(info["methods"]), } for domain, info in sorted(domains.items(), key=lambda item: -item[1]["count"]) ] return _json_response(result)