Class: GroqRuby::MCP::Prompt

Inherits:
Object
  • Object
show all
Defined in:
lib/groq_ruby/mcp/prompt.rb

Overview

An MCP prompt template advertised by a server’s ‘prompts/list` response. Prompts are typically surfaced to users as a picker rather than handed to the LLM directly — the user fills in the arguments and the server returns ready-to-send messages via `prompts/get`.

Class Method Summary collapse

Class Method Details

.from_hash(hash) ⇒ Prompt?

Parameters:

  • hash (Hash, nil)

Returns:



11
12
13
14
15
16
17
18
# File 'lib/groq_ruby/mcp/prompt.rb', line 11

def self.from_hash(hash)
  return nil if hash.nil?
  new(
    name: hash["name"] || hash[:name],
    description: hash["description"] || hash[:description],
    arguments: Array(hash["arguments"] || hash[:arguments])
  )
end