ToolHints

org.llm4s.toolapi.ToolHints
See theToolHints companion object
@Experimental
final case class ToolHints

What a tool is likely to do, with the meanings of the MCP tool annotations and their conservative defaults. These are hints a middleware reads (for example to ask approval for a tool that is not read-only), not guarantees: nothing checks that a tool behaves as it says.

It lives in llm4s-core so that both llm4s-agent, whose tool contract carries it, and llm4s-mcp, which reads it from a server's tool annotations, can see it: neither module depends on the other.

Value parameters

destructive

MCP destructiveHint: the tool may perform destructive updates rather than only additive ones; meaningful only when it is not readOnly

idempotent

MCP idempotentHint: calling it again with the same arguments has no further effect; meaningful only when it is not readOnly

openWorld

MCP openWorldHint: the tool may interact with an open world of external entities, such as the web, rather than a closed domain

readOnly

MCP readOnlyHint: the tool does not modify its environment

Attributes

Companion
object
Source
ToolHints.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Sets the destructiveHint. Meaningful only when the tool is not read-only.

Sets the destructiveHint. Meaningful only when the tool is not read-only.

Value parameters

v

true if the tool may perform destructive updates rather than only additive ones

Attributes

Returns

new ToolHints with destructive set; this is a hint, not a guarantee

Source
ToolHints.scala

Sets the idempotentHint. Meaningful only when the tool is not read-only.

Sets the idempotentHint. Meaningful only when the tool is not read-only.

Value parameters

v

true if calling the tool again with the same arguments has no further effect

Attributes

Returns

new ToolHints with idempotent set; this is a hint, not a guarantee

Source
ToolHints.scala

Sets the openWorldHint.

Sets the openWorldHint.

Value parameters

v

true if the tool may interact with an open world of external entities, such as the web, rather than a closed domain

Attributes

Returns

new ToolHints with openWorld set; this is a hint, not a guarantee

Source
ToolHints.scala

Sets the readOnlyHint.

Sets the readOnlyHint.

Value parameters

v

true if the tool does not modify its environment

Attributes

Returns

new ToolHints with readOnly set; this is a hint, not a guarantee

Source
ToolHints.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product