Package dev.tachyonmcp.api.server.domain
Interface Annotations
@Immutable
public interface Annotations
Optional metadata that clients can use to tailor how content is presented.
audience hints at the intended role (user/assistant), priority controls
ordering, and lastModified carries an RFC-3339 timestamp of the last modification.
All fields are null when absent — omit the annotation block entirely rather than
sending empty values.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionaudience()Intended audience roles, ornullwhen unrestricted.static Annotations.Builderbuilder()Creates a new builder.default voidValidates that the priority is within the range from 0.0 to 1.0.@Nullable StringRFC-3339 timestamp of the last modification, ornullwhen unknown.static AnnotationsCreates annotations with the given values.@Nullable Doublepriority()Ordering hint in[0.0, 1.0], ornullfor default.
-
Method Details
-
audience
Intended audience roles, ornullwhen unrestricted.- Returns:
- the audience list, or
null
-
priority
@Nullable Double priority()Ordering hint in[0.0, 1.0], ornullfor default.- Returns:
- the priority, or
null
-
lastModified
@Nullable String lastModified()RFC-3339 timestamp of the last modification, ornullwhen unknown.- Returns:
- the last-modified timestamp, or
null
-
checkPriority
@Check default void checkPriority()Validates that the priority is within the range from 0.0 to 1.0.- Throws:
IllegalArgumentException- if the priority is NaN or outside the range from 0.0 to 1.0
-
builder
Creates a new builder.- Returns:
- a new builder
-
of
static Annotations of(@Nullable List<Role> audience, @Nullable Double priority, @Nullable String lastModified) Creates annotations with the given values.- Parameters:
audience- intended audience roles, ornullpriority- ordering hint, ornulllastModified- RFC-3339 timestamp, ornull- Returns:
- the new annotations
-