AppFunctionBehaviorHintsMetadata


public final class AppFunctionBehaviorHintsMetadata


Advisory hints about the runtime behavior of an app function.

The properties conform to the Model Context Protocol (MCP) ToolAnnotations specification: isReadOnly, isDestructive, isIdempotent, and isOpenWorld.

Callers must account for the following semantics when interpreting these hints:

  • No binding contract: Hints are purely advisory and do not prescribe how callers should react. Turning hints into a policy (for example, prompting for confirmation before calling a function with isDestructive set to true) is entirely up to the caller.

  • Untrusted by default: Hints are self-reported by the providing app and are not verified to match the function's actual implementation. Callers should not rely on hints from untrusted apps for security-critical decisions.

  • No validation: The library does not validate hint values or combinations at declaration time, construction time, or reading time. Behavior hints are bespoke signals between the providing app (server) and caller (client) that the library does not mediate; the values are passed through as-is for the caller and providing app to interpret.

Summary

Public constructors

AppFunctionBehaviorHintsMetadata(
    boolean isReadOnly,
    boolean isDestructive,
    boolean isIdempotent,
    boolean isOpenWorld
)

Public methods

boolean
equals(Object other)
int
final boolean

Whether the app function may perform destructive updates to its environment, as opposed to purely additive updates.

final boolean

Whether calling the app function repeatedly with the same arguments has no additional effect on its environment.

final boolean

Whether the app function may interact with an external "open world" of entities, as opposed to operating strictly within a closed domain.

final boolean

Whether the app function does not modify its environment.

@NonNull String

Public constructors

AppFunctionBehaviorHintsMetadata

Added in 1.1.0-alpha01
public AppFunctionBehaviorHintsMetadata(
    boolean isReadOnly,
    boolean isDestructive,
    boolean isIdempotent,
    boolean isOpenWorld
)

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

isDestructive

Added in 1.1.0-alpha01
public final boolean isDestructive()

Whether the app function may perform destructive updates to its environment, as opposed to purely additive updates.

Destructive updates include deleting or overwriting existing data, whereas additive updates only create new records. Meaningful only when the function modifies its environment (that is, when isReadOnly is false).

isIdempotent

Added in 1.1.0-alpha01
public final boolean isIdempotent()

Whether calling the app function repeatedly with the same arguments has no additional effect on its environment.

Meaningful only when the function modifies its environment (that is, when isReadOnly is false).

isOpenWorld

Added in 1.1.0-alpha01
public final boolean isOpenWorld()

Whether the app function may interact with an external "open world" of entities, as opposed to operating strictly within a closed domain.

Examples include searching the web, sending messages to external recipients, or calling third-party services, as opposed to operating strictly within local app storage.

isReadOnly

Added in 1.1.0-alpha01
public final boolean isReadOnly()

Whether the app function does not modify its environment.

toString

public @NonNull String toString()