The type of the parameters for the tool, defaults to a record of ToolValue.
OptionalcallbacksOptional lifecycle callbacks for the tool, allowing customization of execution flow.
OptionaldocOptional description for documentation purposes, aiding in tool usage understanding.
Optional dynamic factory to resolve tool metadata
A human-readable description of the function’s purpose. Informs the model or users about the tool's functionality (e.g., "Performs a search query"), used in tool selection or documentation. Not directly executed but critical for model understanding in ClientAgent workflows.
The name of the function, uniquely identifying the tool. Must match IToolCall.function.name for execution (e.g., "search" in ClientAgent.tools), serving as the key for tool lookup and invocation. Example: "calculate" for a math tool.
The schema defining the parameters required by the function. Specifies the structure, types, and constraints of arguments (e.g., IToolCall.function.arguments), validated in ClientAgent (e.g., targetFn.validate). Provides the model with a blueprint for generating valid tool calls.
A key-value map defining the properties of the parameters. Details each argument’s type, description, and optional constraints, guiding the model and agent in constructing and validating tool calls (e.g., in ClientAgent.EXECUTE_FN).
An array of parameter names that are mandatory for the function. Lists keys that must be present in IToolCall.function.arguments, enforced during validation (e.g., ClientAgent.targetFn.validate). Example: ["query"] for a search tool requiring a query string.
The type of the parameters object, typically "object". Indicates that parameters are a key-value structure, as expected by IToolCall.function.arguments in ClientAgent. Example: "object" for a standard JSON-like parameter set.
OptionalisChecks if the tool is available for execution. This method can be used to determine if the tool can be executed based on the current context.
The unique name of the tool, used for identification within the agent swarm.
Tool type defenition. For now, should be function
OptionalvalidateValidates the tool parameters before execution. Can return synchronously or asynchronously based on validation complexity.
Interface representing a tool used by an agent, extending the base ITool interface. Defines the tool's execution and validation logic, with optional lifecycle callbacks.