ToolUse

@SerialName(value = "tool_use")
data class ToolUse(val id: String, val name: String, val input: JsonObject, val cacheControl: AnthropicCacheControl? = null) : AnthropicContent(source)

Represents the usage of a tool in a structured format.

This class is part of the AnthropicContent sealed class hierarchy and is identified by the serial name tool_use. It contains information about the tool being used, including a unique identifier, a name to describe the tool, and a JSON object for input parameters or configurations needed for the tool's operation.

Constructors

Link copied to clipboard
constructor(id: String, name: String, input: JsonObject, cacheControl: AnthropicCacheControl? = null)

Properties

Link copied to clipboard

Optional cache control directive for explicit breakpoint prompt caching. When set on the last content block in the list, all content blocks are eligible for caching.

Link copied to clipboard
val id: String

A unique identifier for the tool usage.

Link copied to clipboard

A JSON object containing input parameters for the tool's operation.

Link copied to clipboard

The name of the tool being used.