Class: Msf::MCP::Tools::ModuleResults
- Inherits:
-
MCP::Tool
- Object
- MCP::Tool
- Msf::MCP::Tools::ModuleResults
- Extended by:
- ToolHelper
- Defined in:
- lib/msf/core/mcp/tools/module_results.rb
Overview
MCP Tool: Retrieve Module Run Results
Polls the ‘module.results` RPC endpoint with a UUID returned by ModuleExecute or ModuleCheck and returns the current status.
Constant Summary
Constants included from ToolHelper
ToolHelper::DANGEROUS_MODE_DISABLED_MESSAGE
Class Method Summary collapse
-
.call(uuid:, server_context:) ⇒ MCP::Tool::Response
Execute results lookup.
Methods included from ToolHelper
dangerous_mode_required!, tool_error_response, with_tool_context
Class Method Details
.call(uuid:, server_context:) ⇒ MCP::Tool::Response
Execute results lookup
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/msf/core/mcp/tools/module_results.rb', line 66 def call(uuid:, server_context:) with_tool_context(server_context, 'module_results') do |msf_client| Msf::MCP::Security::InputValidator.validate_uuid!(uuid) raw_result, elapsed = Rex::Stopwatch.elapsed_time do msf_client.module_results(uuid) end data = raw_result.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } = { query_time: elapsed.round(3) } ::MCP::Tool::Response.new( [{ type: 'text', text: JSON.generate(metadata: , data: data) }], structured_content: { metadata: , data: data } ) end end |