AIClientToolDefinition

data class AIClientToolDefinition(val name: String, val description: String = "", val inputSchema: Map<String, Any?>? = null, val isReadOnly: Boolean = false)

The name, description, argument schema and read-only hint of a client tool, as the agent sees them.

It reads and writes the same JSON as a Model Context Protocol tool (name, description, inputSchema and the readOnlyHint of its annotations), so a renderer can put it into the model's instructions as it is, and a tool described for MCP converts with fromJson:

{
"name": "calendar",
"description": "The person's events on a day.",
"inputSchema": { "type": "object", "properties": { "day": { "type": "string" } }, "required": ["day"] },
"annotations": { "readOnlyHint": true }
}

Constructors

Link copied to clipboard
constructor(name: String, description: String = "", inputSchema: Map<String, Any?>? = null, isReadOnly: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

What the tool does, for the agent, or empty when it says nothing.

Link copied to clipboard

The JSON Schema of the tool's arguments, as plain Kotlin values, or null when it describes none.

Link copied to clipboard

Whether the tool only reads and changes nothing.

Link copied to clipboard

The unique name of the tool.

Functions

Link copied to clipboard
fun toJson(): Map<String, Any?>

The definition as its portable JSON, in plain Kotlin values. An empty description and a missing schema are left out.

Link copied to clipboard

The definition as its portable JSON text, with sorted keys.