Skip to content

Full prompt support + resource and tool content support improvments#12

Merged
patvice merged 9 commits intomainfrom
full-prompt-support
Jun 17, 2025
Merged

Full prompt support + resource and tool content support improvments#12
patvice merged 9 commits intomainfrom
full-prompt-support

Conversation

@patvice
Copy link
Owner

@patvice patvice commented Jun 17, 2025

Add Full Prompt Support to RubyLLM-MCP

Overview

This PR introduces comprehensive prompt support to the RubyLLM-MCP gem, allowing users to leverage predefined MCP prompts with arguments for consistent and powerful LLM interactions. This enhancement complements the existing tool and resource capabilities, making the gem a complete MCP integration solution.

Key Features Added

Prompt Management

  • Prompt Discovery: List and access available prompts from MCP servers
  • Argument Handling: Support for required and optional prompt arguments with validation
  • Flexible Integration: Multiple ways to include prompts in conversations

Enhanced Chat Interface

  • chat.ask_prompt(prompt, arguments: {}) - Direct prompt execution
  • chat.with_prompt(prompt, arguments: {}) - Add prompts to conversation context
  • prompt.include(chat, arguments: {}) - Direct prompt inclusion method

New Classes & Components

  • RubyLLM::MCP::Prompt - Core prompt object with argument validation
  • RubyLLM::MCP::Attachment - Message attachment handling
  • RubyLLM::MCP::Content - Content type management
  • RubyLLM::MCP::Completion - Completion data structures
  • Prompt request handlers for list and call operations

Additional Improvements

Enhanced Tool Support

  • Improved tool call handling to support formats beyond plain text
  • Better response parsing and content extraction

Resource Enhancements

  • Updated resource support to use proper content returns
  • Better content handling and extraction

@patvice patvice merged commit 6a671b8 into main Jun 17, 2025
1 check passed
@patvice patvice deleted the full-prompt-support branch June 17, 2025 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant