Module: Msf::MCP::Tools::ToolHelper
- Included in:
- CredentialInfo, HostInfo, LootInfo, ModuleInfo, NoteInfo, SearchModules, ServiceInfo, VulnerabilityInfo
- Defined in:
- lib/msf/core/mcp/tools/tool_helper.rb
Overview
Shared helper methods for MCP tools.
Provides a standard way to build error responses that comply with the MCP protocol, returning a normal result with ‘isError: true` instead of raising exceptions that the MCP server would wrap as internal errors.
Instance Method Summary collapse
-
#tool_error_response(message) ⇒ ::MCP::Tool::Response
Build a standard MCP error response.
Instance Method Details
#tool_error_response(message) ⇒ ::MCP::Tool::Response
Build a standard MCP error response.
19 20 21 22 23 24 |
# File 'lib/msf/core/mcp/tools/tool_helper.rb', line 19 def tool_error_response() ::MCP::Tool::Response.new( [{ type: 'text', text: }], error: true ) end |