proxy_list_targets
Filter and retrieve status of target domains for automated traffic monitoring and analysis using the Web Proxy MCP Server.
Instructions
List all target domains and their status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter targets by status | all |
Implementation Reference
- src/tools/tool-definitions.js:57-71 (schema)Defines the input schema and metadata for the proxy_list_targets tool, including optional status filter.proxy_list_targets: { name: "proxy_list_targets", description: "List all target domains and their status", inputSchema: { type: "object", properties: { status: { type: "string", enum: ["all", "active", "inactive"], description: "Filter targets by status", default: "all" } } } },
- src/tools/tool-handlers.js:184-195 (handler)Tool handler case that executes proxy_list_targets by calling targetManager.listTargets and formatting the response as a formatted text list with stats.case 'proxy_list_targets': const targets = this.targetManager.listTargets(args.status); const targetList = targets.map(t => `• ${t.domain} (${t.status}) - ${t.description || 'No description'}` ).join('\n'); return { content: [{ type: "text", text: `📋 Proxy Targets (${targets.length})\n\n${targetList || 'No targets configured'}\n\nStats: ${JSON.stringify(this.targetManager.getStats(), null, 2)}` }] };
- src/proxy/target-manager.js:90-103 (helper)Core implementation of listTargets method in TargetManager class, which retrieves all targets from internal Map, computes status, and filters based on statusFilter.listTargets(statusFilter = 'all') { const targets = Array.from(this.targets.values()).map(target => ({ ...target, status: target.enabled ? 'active' : 'inactive' })); if (statusFilter === 'active') { return targets.filter(t => t.enabled); } else if (statusFilter === 'inactive') { return targets.filter(t => !t.enabled); } return targets; }
- index.js:66-74 (registration)Registers all tools including proxy_list_targets for MCP ListToolsRequest by exposing TOOLS definitions.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });
- index.js:77-99 (registration)Registers the generic tool call handler which dispatches to ToolHandlers.handleTool for executing proxy_list_targets and other tools.this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await this.toolHandlers.handleTool(name, args || {}); if (result.isError) { throw new McpError( ErrorCode.InternalError, result.error ); } return result; } catch (error) { console.error(`Tool error [${name}]:`, error.message); throw new McpError( ErrorCode.InternalError, `Tool execution failed: ${error.message}` ); } });