0.0
No release in over 3 years
SharedTools provides a collection of reusable common tools (aka callback functions) for Ruby applications using various LLM-provider API gems.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.0
~> 13.0
~> 3.0
~> 1.3.1
>= 0
>= 0
>= 0
~> 0.5.1

Runtime

~> 2.6
 Project Readme

Shared Tools

Two Robots sharing the same set of tools.

A Ruby gem providing a collection of common tools (call-back functions) for use with the following gems:

  • ruby_llm: multi-provider gem install ruby_llm
  • llm: multi-provider gem install llm.rb
  • omniai: multi-provider gem install omniai-tools (Not part of the SharedTools namespace)
  • more to come ...

Recent Changes

Version 0.2.0

  • ability to use the ruby_llm-mcp gem was added with two example MCP client instances for some useful MCP servers: github-mcp-server and iMCP.app
  • added SharedTools.mcp_servers Array to hold defined client instances.
  • added a class method name to RubyLLM::Tool subclasses to define the snake_case String format of the class basename.

Installation

gem install shared_tools

# Load all RubyLLM tools (requires ruby_llm gem to be available and loaded first)
require 'shared_tools/ruby_llm' # multiple API libraries are supported besides ruby_llm

# Or load a specific tool directly
require 'shared_tools/ruby_llm/edit_file'
require 'shared_tools/ruby_llm/read_file'
require 'shared_tools/ruby_llm/python_eval'

# Or load clients for defined MCP servers
# Load all the MCP clients for the ruby_llm library
require 'shared_tools/ruby_llm/mcp'

# Or just the ones you want
require 'shared_tools/ruby_llm/mcp/github_mcp_server'
require 'shared_tools/ruby_llm/mcp/icmp' # MacOS data server

# The client instances for ruby_llm/mcp servers are available
SharedTools.mcp_servers # An Array of MCP clients

# In ruby_llm library access the tools from MCP servers
@tools = []
SharedTools.mcp_servers.size.time  do |server_inx|
  @tools += SharedTools.mcp_servers[server_inx].tools
end
chat = RubyLLM.chat
chat.with_tools(@tools)

Tips for Tool Authors

  • Provide a clear comprehensive description for your tool and its parameters
  • Include usage examples in your documentation
  • Ensure your tool is compatible with different Ruby versions and environments
  • Make sure your tool is in the correct directory for the library to which it belongs

Rails and Autoloader Compatibility

This gem uses Zeitwerk for autoloading, making it fully compatible with Rails and other Ruby applications that use modern autoloaders. RubyLLM tools are excluded from autoloading and loaded manually to avoid namespace conflicts.

Special Thanks

A special shout-out to Kevin's omniai-tools gem, which is a curated collection of tools for use with his OmniAI gem.