Module: Protege::ToolMixin::ClassMethods

Defined in:
lib/protege/extensions/tool_mixin.rb

Overview

Class-level DSL mixed into every tool class via Tool.included. The tool's id, description, and display_name come from the shared Extensions::Manifested concern (a tool's id is its class basename with the Tool suffix stripped, e.g. SendEmailTool → :send_email); only input_schema, which describes call-time input rather than manifest metadata, lives here.

Instance Method Summary collapse

Instance Method Details

#input_schema(schema = nil) ⇒ Hash?

Declare or read the JSON Schema describing this tool's input parameters.

With an argument, sets the schema; with no argument, returns the previously declared value.

Parameters:

  • schema (Hash, nil) (defaults to: nil)

    the JSON Schema to set, or nil to read

Returns:

  • (Hash, nil)

    the current input schema



186
187
188
189
190
# File 'lib/protege/extensions/tool_mixin.rb', line 186

def input_schema(schema = nil)
  return @input_schema if schema.nil?

  @input_schema = schema
end