Package dev.miyomiyo.agentbridge.api
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 ClassesModifier and TypeClassDescriptionstatic enumREAD_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 enumHow retries are identified; independent of the tool's world/location scope.static enumWORLD survives dimension travel; LOCATION belongs to the exact observed location revision. -
Constructor Summary
ConstructorsConstructorDescriptionToolDefinition(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 aToolDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionjava.lang.StringReturns the value of thedescriptionrecord component.effect()Returns the value of theeffectrecord component.final booleanequals(java.lang.Object o) Indicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.java.lang.Stringname()Returns the value of thenamerecord component.java.lang.StringReturns the value of theparametersSchemarecord component.replay()Returns the value of thereplayrecord component.scope()Returns the value of thescoperecord component.java.lang.Stringtitle()Returns the value of thetitlerecord component.final java.lang.StringtoString()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 aToolDefinitionrecord class.- Parameters:
name- the value for thenamerecord componenttitle- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componentparametersSchema- the value for theparametersSchemarecord componentscope- the value for thescoperecord componenteffect- the value for theeffectrecord componentreplay- the value for thereplayrecord 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:
toStringin classjava.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:
hashCodein classjava.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 withObjects::equals(Object,Object).- Specified by:
equalsin classjava.lang.Record- Parameters:
o- the object with which to compare- Returns:
trueif this object is the same as theoargument;falseotherwise.
-
name
public java.lang.String name()Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
title
public java.lang.String title()Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
description
public java.lang.String description()Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
parametersSchema
public java.lang.String parametersSchema()Returns the value of theparametersSchemarecord component.- Returns:
- the value of the
parametersSchemarecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
effect
Returns the value of theeffectrecord component.- Returns:
- the value of the
effectrecord component
-
replay
Returns the value of thereplayrecord component.- Returns:
- the value of the
replayrecord component
-