Module: ActionModelContext::Primitive

Extended by:
ActiveSupport::Concern
Included in:
Prompt, Resource, Tool
Defined in:
lib/action_model_context/primitive.rb

Overview

Shared by Tool, Resource and Prompt: the class macros that name and describe a primitive, and rescue_from, which works as in a controller.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#context ⇒ Object (readonly)

The context of the request: what the controller's mcp_context returned.

Returns:

  • (Object)

Class Method Details

.description(text = nil) ⇒ String?

Declares the description, or reads it: a declared value wins over I18n.

Parameters:

  • text (String, nil) (defaults to: nil) —

    the description to declare

Returns:

  • (String, nil) —

    nil when neither the class nor I18n has one

.title(text = nil) ⇒ String?

Declares the title, or reads it: a declared value wins over I18n.

Parameters:

  • text (String, nil) (defaults to: nil) —

    the title to declare

Returns:

  • (String, nil) —

    nil when neither the class nor I18n has one