OptionaldescriptionA natural-language description of what the tool does.
The unique name of the tool or function.
A [Value] describing the JSON Schema of the expected parameters.
Typically an object schema such as { "type": "object", "properties": ... }.
OptionalreturnsAn optional [Value] that defines the return value schema.
If omitted, the tool is assumed to return free-form text or JSON.
Describes a tool (or function) that a language model can invoke.
ToolDescdefines the schema, behavior, and input/output specification of a callable external function, allowing an LLM to understand how to use it.The primary role of this struct is to describe to the LLM what a tool does, how it can be invoked, and what input (
parameters) and output (returns) schemas it expects.The format follows the same schema conventions used by Hugging Face’s
transformerslibrary, as well as APIs such as OpenAI and Anthropic. Theparametersandreturnsfields are typically defined using JSON Schema.We provide a builder [
ToolDescBuilder] helper for convenient and fluent construction. Please refer to [ToolDescBuilder].Example