Skip to main content

load_tools

Function load_tools 

Source
pub fn load_tools(json: &str) -> Result<Vec<Tool>>
Expand description

Reads the tools this client is willing to have called.

§Why a client needs this at all

In AG-UI the client offers the tools and the agent picks from them, so an agent that executes add_task only sees it if the front-end sent it. There is no handshake: nothing in the protocol lets a generic client ask an agent what it needs, and an agent handed none simply fails the run. A client that is not written against one specific agent therefore has to be configured with the tool set, which is what this loads.

§Errors

The file’s contents, if they are not a JSON array of tool definitions.