Class: CodeSnippetTool

Inherits:
FastMcp::Tool
  • Object
show all
Defined in:
lib/yardmcp.rb

Overview

Tool: Fetch code snippet for a YARD object from installed gems

Instance Method Summary collapse

Instance Method Details

#call(path:) ⇒ Object



436
437
438
439
# File 'lib/yardmcp.rb', line 436

def call(path:)
  snippet = YardUtils.instance.code_snippet(path)
  { content: { text: snippet, type: 'code_snippet' } }
end