Expand description
Tools: executable functions and hosted-tool markers.
Rust equivalent of agent_framework._tools. An FunctionTool is a locally
executable tool; hosted ToolKind variants are markers handed to the service.
Both are represented uniformly to a chat client as a ToolDefinition.
Prefer FunctionTool::typed over FunctionTool::new when the arguments can
be expressed as a #[derive(Deserialize, JsonSchema)] struct: it derives the
parameters JSON Schema via schemars instead of requiring a hand-written
serde_json::Value.
Structs§
- Function
Invocation Config - Configuration for the automatic function-invocation loop.
- Function
Tool - A concrete, locally executable tool built from a closure.
- Tool
Definition - A uniform, cloneable descriptor of a tool passed via
ChatOptions::tools.
Enums§
- Approval
Mode - Whether a call to a tool must be approved by a human before it runs.
- McpApproval
Mode - The approval gate configured on a hosted MCP connector – i.e. how the
service itself decides whether a call to one of its MCP tools needs human
sign-off before it runs. Set via
ToolDefinition::mcp_approval_mode. - Tool
Kind - The category of a tool as advertised to the service.
Traits§
- Tool
- An executable tool the framework can invoke locally.
- Tool
Source - A dynamic source of tools, resolved fresh on every agent run instead of being frozen into the agent’s tool list at build time.
Functions§
- empty_
schema - An empty JSON-Schema object (no parameters).
- hosted_
code_ interpreter - Construct a hosted code-interpreter tool marker.
- hosted_
file_ search - Construct a hosted file-search tool marker.
- hosted_
image_ generation - Construct a hosted image-generation tool marker.
- hosted_
mcp - Construct a hosted MCP tool marker.
- hosted_
web_ search - Construct a hosted web-search tool marker.
Type Aliases§
- BoxFuture
- A boxed, owned future returned by a tool invocation.