Skip to main content
Glama

suggest_next_steps

Analyze penetration testing scan results to recommend logical next steps for security assessments, guiding testers through effective vulnerability investigation and exploitation workflows.

Instructions

Analyze current findings and suggest next steps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scan_resultsYesPrevious scan results in JSON format

Implementation Reference

  • Core handler function implementing the suggest_next_steps tool logic. Parses input scan results, analyzes different categories of findings using helper methods, generates prioritized next-step recommendations, and returns a structured response.
    async suggestNextSteps(scanResults: string): Promise<ScanResult> { try { const results = JSON.parse(scanResults); const recommendations: NextStepsRecommendation[] = []; // Analyze reconnaissance results if (results.reconnaissance) { recommendations.push(...this.analyzeReconResults(results.reconnaissance)); } // Analyze vulnerability results if (results.vulnerabilities) { recommendations.push(...this.analyzeVulnResults(results.vulnerabilities)); } // Analyze exploitation results if (results.exploits) { recommendations.push(...this.analyzeExploitResults(results.exploits)); } // Sort recommendations by priority and risk recommendations.sort((a, b) => { const priorityOrder = { high: 3, medium: 2, low: 1 }; const riskOrder = { critical: 4, high: 3, medium: 2, low: 1 }; const aScore = priorityOrder[a.priority] + riskOrder[a.risk_level]; const bScore = priorityOrder[b.priority] + riskOrder[b.risk_level]; return bScore - aScore; }); return { target: 'analysis', timestamp: new Date().toISOString(), tool: 'suggest_next_steps', results: { recommendations: recommendations.slice(0, 10), // Top 10 recommendations total_recommendations: recommendations.length, analysis_summary: this.generateAnalysisSummary(results) }, status: 'success' }; } catch (error) { return { target: 'analysis', timestamp: new Date().toISOString(), tool: 'suggest_next_steps', results: {}, status: 'error', error: error instanceof Error ? error.message : String(error) }; } }
  • src/index.ts:224-234 (registration)
    Tool registration in the ListToolsRequest handler, including name, description, and input schema definition.
    { name: "suggest_next_steps", description: "Analyze current findings and suggest next steps", inputSchema: { type: "object", properties: { scan_results: { type: "string", description: "Previous scan results in JSON format" } }, required: ["scan_results"] } },
  • Input schema definition for the suggest_next_steps tool, specifying the required scan_results parameter as a JSON string.
    inputSchema: { type: "object", properties: { scan_results: { type: "string", description: "Previous scan results in JSON format" } }, required: ["scan_results"] }
  • Dispatch handler in the CallToolRequest switch statement that routes calls to the workflow engine's suggestNextSteps method.
    case "suggest_next_steps": return respond(await this.workflowEngine.suggestNextSteps(args.scan_results));
  • Helper method for analyzing reconnaissance results (ports, services) and generating specific next-step recommendations.
    private analyzeReconResults(recon: any): NextStepsRecommendation[] { const recommendations: NextStepsRecommendation[] = []; if (recon.open_ports && recon.open_ports.length > 0) { const webPorts = recon.open_ports.filter((p: any) => p.port === 80 || p.port === 443 || p.port === 8080); if (webPorts.length > 0) { recommendations.push({ priority: 'high', action: 'Perform web application vulnerability scan', tool: 'nuclei_scan', reason: 'Web services detected on target', estimated_time: '10-30 minutes', risk_level: 'medium' }); } const sshPorts = recon.open_ports.filter((p: any) => p.port === 22); if (sshPorts.length > 0) { recommendations.push({ priority: 'medium', action: 'Test SSH for weak credentials', tool: 'ssh_bruteforce', reason: 'SSH service exposed', estimated_time: '30-60 minutes', risk_level: 'high' }); } } return recommendations; }

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/adriyansyah-mf/mcp-pentest'

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