class RubyLLM::MCP::Prompt
A prompt an MCP server offers: messages written by the server and filled in with your arguments. Ask a chat with it like a question.
github.prompts # => [#<RubyLLM::MCP::Prompt name: "code_review", ...>] review = github.prompt(:code_review, code: diff) review.messages # => [#<RubyLLM::Message role: :user, ...>] chat.ask review
Constants
- Argument
-
An argument a prompt takes.
Attributes
The arguments the prompt takes, as Argument objects.
What the prompt does, or nil.
The prompt’s name.
A human-readable title, or nil.
Public Instance Methods
Source
# File lib/ruby_llm/mcp/prompt.rb, line 50 def messages @messages || [] end
Returns the prompt’s messages as Message objects. A prompt from MCP#prompts has none until you fill it in with MCP#prompt.
Source
# File lib/ruby_llm/mcp/prompt.rb, line 60 def suggest(**arguments) @mcp.suggest({ type: 'ref/prompt', name: }, arguments) end
Asks the server to complete an argument’s partial value. Pass one argument to complete and any others that are already filled in. Returns an Array of suggested values.
github.prompts.first.suggest(language: "ru") # => ["ruby", "rust"]