Class: Evilution::MCP::SessionShowTool Deprecated
- Inherits:
-
MCP::Tool
- Object
- MCP::Tool
- Evilution::MCP::SessionShowTool
- Defined in:
- lib/evilution/mcp/session_show_tool.rb
Overview
Deprecated.
Superseded by SessionTool (action: “show”) as of 0.22.8. No longer registered with the MCP server; retained only for direct Ruby callers. Will be removed entirely — tracked by EV-h8pw / GH #686.
Class Method Summary collapse
-
.call(server_context:, path: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument.
Class Method Details
.call(server_context:, path: nil) ⇒ Object
rubocop:disable Lint/UnusedMethodArgument
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/evilution/mcp/session_show_tool.rb', line 28 def call(server_context:, path: nil) unless path return ::MCP::Tool::Response.new( [{ type: "text", text: ::JSON.generate({ error: { type: "config_error", message: "path is required" } }) }], error: true ) end store = Evilution::Session::Store.new data = store.load(path) ::MCP::Tool::Response.new([{ type: "text", text: ::JSON.generate(data) }]) rescue Evilution::Error => e ::MCP::Tool::Response.new( [{ type: "text", text: ::JSON.generate({ error: { type: "not_found", message: e. } }) }], error: true ) rescue ::JSON::ParserError => e ::MCP::Tool::Response.new( [{ type: "text", text: ::JSON.generate({ error: { type: "parse_error", message: e. } }) }], error: true ) rescue SystemCallError => e ::MCP::Tool::Response.new( [{ type: "text", text: ::JSON.generate({ error: { type: "runtime_error", message: e. } }) }], error: true ) end |