Record Class ToolDefinition

java.lang.Object
java.lang.Record
dev.miyomiyo.agentbridge.api.ToolDefinition

public record ToolDefinition(java.lang.String name, java.lang.String title, java.lang.String description, java.lang.String parametersSchema, ToolDefinition.Scope scope, ToolDefinition.Effect effect, ToolDefinition.Replay replay) extends java.lang.Record
An independent tool exposed as mc_<name>. The semantic name is globally unique; ownership stays with the registering mod. Queries use QueryDefinition and player-facing UI uses UiDefinition rather than adding independent tools for each output format. Artifact ID parameters declare "type":"string","format":"agentbridge-artifact". The host retains these imported artifacts from dispatch until the call terminates, including references nested in arrays/objects and matching schema branches. Ordinary strings are not interpreted as references. Use CallContext.readArtifact(String) to read the bytes.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    READ_ONLY observes; ASSISTANCE manages assistant-owned UI/plans without changing gameplay; GAME_CHANGE requires cheat mode and confirmation for each operation; the command auto-allow setting does not grant it.
    static enum 
    How retries are identified; independent of the tool's world/location scope.
    static enum 
    WORLD survives dimension travel; LOCATION belongs to the exact observed location revision.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ToolDefinition(java.lang.String name, java.lang.String title, java.lang.String description, java.lang.String parametersSchema, ToolDefinition.Scope scope, ToolDefinition.Effect effect)
    Creates a tool whose handler runs for every accepted call.
    ToolDefinition(java.lang.String name, java.lang.String title, java.lang.String description, java.lang.String parametersSchema, ToolDefinition.Scope scope, ToolDefinition.Effect effect, ToolDefinition.Replay replay)
    Creates an instance of a ToolDefinition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    java.lang.String
    Returns the value of the description record component.
    Returns the value of the effect record component.
    final boolean
    equals(java.lang.Object o)
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    java.lang.String
    Returns the value of the name record component.
    java.lang.String
    Returns the value of the parametersSchema record component.
    Returns the value of the replay record component.
    Returns the value of the scope record component.
    java.lang.String
    Returns the value of the title record component.
    final java.lang.String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ToolDefinition

      public ToolDefinition(java.lang.String name, java.lang.String title, java.lang.String description, java.lang.String parametersSchema, ToolDefinition.Scope scope, ToolDefinition.Effect effect)
      Creates a tool whose handler runs for every accepted call.
    • ToolDefinition

      public ToolDefinition(java.lang.String name, java.lang.String title, java.lang.String description, java.lang.String parametersSchema, ToolDefinition.Scope scope, ToolDefinition.Effect effect, ToolDefinition.Replay replay)
      Creates an instance of a ToolDefinition record class.
      Parameters:
      name - the value for the name record component
      title - the value for the title record component
      description - the value for the description record component
      parametersSchema - the value for the parametersSchema record component
      scope - the value for the scope record component
      effect - the value for the effect record component
      replay - the value for the replay record component
  • Method Details

    • toString

      public final java.lang.String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class java.lang.Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class java.lang.Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(java.lang.Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class java.lang.Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public java.lang.String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • title

      public java.lang.String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • description

      public java.lang.String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • parametersSchema

      public java.lang.String parametersSchema()
      Returns the value of the parametersSchema record component.
      Returns:
      the value of the parametersSchema record component
    • scope

      public ToolDefinition.Scope scope()
      Returns the value of the scope record component.
      Returns:
      the value of the scope record component
    • effect

      public ToolDefinition.Effect effect()
      Returns the value of the effect record component.
      Returns:
      the value of the effect record component
    • replay

      public ToolDefinition.Replay replay()
      Returns the value of the replay record component.
      Returns:
      the value of the replay record component