kieranklaassen

Tool Tailor — Development skill for Claude Code

Development community

A Gem to convert methods to openai JSON schemas for use with tools.

How to install Tool Tailor

This entry records only its repository, not the path inside it, so there is no exact command to give. Open kieranklaassen/tool_tailor and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Tool Tailor does

A Gem to convert methods to openai JSON schemas for use with tools.

Alternatives in Development

README

ToolTailor

ToolTailor is a focused Ruby gem that converts Ruby methods into JSON schemas for OpenAI and Anthropic tool calling APIs.

Philosophy

ToolTailor is designed as a lightweight building block, not a full framework. It has a single purpose: to convert your existing Ruby methods with YARD documentation into tool schemas for AI tool calling. It doesn't implement the actual API calls or handle responses - it's the glue that helps you expose your existing code to AI systems with minimal effort.

Key principles:

  • Do one thing well: Convert methods to JSON schemas
  • Leverage existing code: Use YARD documentation you already have
  • Minimal dependencies: Just YARD and standard libraries
  • Composable: Works with any API client of your choice
  • Extensible tags: Custom YARD tags for array items, enums, and more

Installation

Add this line to your application's Gemfile:

gem 'tool_tailor'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install tool_tailor

Usage

ToolTailor converts Ruby methods to JSON schemas:

Converting Methods

class WeatherService
  # Get the current weather in a given location.
  #
  # @param location [String] The city and state, e.g., San Francisco, CA.
  # @param unit [String] The temperature unit to use. Infer this from the user's location.
  # @values unit ["Celsius", "Fahrenheit"]
  # @param historical_data [Array] Optional array of previous weather readings
  # @items_type historical_data Object
  # @min_items historical_data 1
  # @max_items historical_data 5
  def get_current_temperature(location:, unit:, historical_data: nil)
    # Function implementation goes here
  end
end

# Convert an instance method
schema = ToolTailor.convert(WeatherService.instance_method(:get_current_temperature))

# Using to_json_schema on an unbound method
schema = WeatherService.instance_method(:get_current_temperature).to_json_schema

# Using to_json_schema on a bound me