Class: RosettAi::Mcp::Tools::DesignShowTool
- Inherits:
-
Object
- Object
- RosettAi::Mcp::Tools::DesignShowTool
- Defined in:
- lib/rosett_ai/mcp/tools/design_show_tool.rb
Overview
MCP tool: show a specific design document.
Returns the full content and metadata of a named design document. Read-only operation.
Constant Summary collapse
- TOOL_NAME =
'rai_design_show'- DESCRIPTION =
'Show details of a specific rai design document'- ANNOTATIONS =
{ 'readOnlyHint' => true, 'destructiveHint' => false, 'idempotentHint' => true, 'openWorldHint' => false }.freeze
Instance Method Summary collapse
-
#call(name:, full: false) ⇒ Hash
Executes the show operation.
Instance Method Details
#call(name:, full: false) ⇒ Hash
Executes the show operation.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rosett_ai/mcp/tools/design_show_tool.rb', line 32 def call(name:, full: false) path = RosettAi.root.join('conf', 'design', "#{name}.yml") return ResponseHelper.error("Design document not found: #{name}") unless path.exist? data = YAML.safe_load_file(path, permitted_classes: [Symbol]) result = { name: data['name'], description: data['description'], status: data['status'], priority: data['priority'], domain: data['domain'], version: data['version'], file: path.basename.to_s } result[:acceptance_criteria] = Array(data['acceptance_criteria']) if full result rescue Psych::SyntaxError => e ResponseHelper.error("YAML parse error in #{name}: #{e.}") end |