Class: MCPClient::Prompt
- Inherits:
-
Object
- Object
- MCPClient::Prompt
- Defined in:
- lib/mcp_client/prompt.rb
Overview
Representation of an MCP prompt
Instance Attribute Summary collapse
-
#arguments ⇒ Hash
readonly
The JSON arguments for the prompt.
-
#description ⇒ String
readonly
The description of the prompt.
-
#name ⇒ String
readonly
The name of the prompt.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Class Method Summary collapse
-
.from_json(data, server: nil) ⇒ MCPClient::Prompt
Create a Prompt instance from JSON data.
Instance Method Summary collapse
-
#initialize(name:, description:, arguments: {}, server: nil) ⇒ Prompt
constructor
Initialize a new prompt.
Constructor Details
#initialize(name:, description:, arguments: {}, server: nil) ⇒ Prompt
Initialize a new prompt
21 22 23 24 25 26 |
# File 'lib/mcp_client/prompt.rb', line 21 def initialize(name:, description:, arguments: {}, server: nil) @name = name @description = description @arguments = arguments @server = server end |
Instance Attribute Details
#arguments ⇒ Hash (readonly)
Returns the JSON arguments for the prompt.
14 |
# File 'lib/mcp_client/prompt.rb', line 14 attr_reader :name, :description, :arguments, :server |
#description ⇒ String (readonly)
Returns the description of the prompt.
14 |
# File 'lib/mcp_client/prompt.rb', line 14 attr_reader :name, :description, :arguments, :server |
#name ⇒ String (readonly)
Returns the name of the prompt.
14 15 16 |
# File 'lib/mcp_client/prompt.rb', line 14 def name @name end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
14 |
# File 'lib/mcp_client/prompt.rb', line 14 attr_reader :name, :description, :arguments, :server |
Class Method Details
.from_json(data, server: nil) ⇒ MCPClient::Prompt
Create a Prompt instance from JSON data
32 33 34 35 36 37 38 39 |
# File 'lib/mcp_client/prompt.rb', line 32 def self.from_json(data, server: nil) new( name: data['name'], description: data['description'], arguments: data['arguments'] || {}, server: server ) end |