Agents 0.0.2
Edge AI Agents SDK
Loading...
Searching...
No Matches
agents::tools::ToolRegistry Class Reference

Registry for tools that agents can use. More...

#include <tool_registry.h>

Public Member Functions

void registerTool (std::shared_ptr< Tool > tool)
 Register a tool.
 
std::shared_ptr< ToolgetTool (const String &name) const
 Get a tool by name.
 
std::vector< std::shared_ptr< Tool > > getAllTools () const
 Get all registered tools.
 
bool hasTool (const String &name) const
 Check if a tool is registered.
 
void removeTool (const String &name)
 Remove a tool.
 
void clear ()
 Clear all tools.
 
JsonObject getToolSchemas () const
 Get tool schemas as JSON.
 

Static Public Member Functions

static ToolRegistryglobal ()
 Get the global tool registry.
 

Detailed Description

Registry for tools that agents can use.

The ToolRegistry provides a central place to register, retrieve, and manage tools that agents can use.

Member Function Documentation

◆ getAllTools()

std::vector< std::shared_ptr< Tool > > agents::tools::ToolRegistry::getAllTools ( ) const

Get all registered tools.

Returns
The tools

◆ getTool()

std::shared_ptr< Tool > agents::tools::ToolRegistry::getTool ( const String & name) const

Get a tool by name.

Parameters
nameThe name of the tool
Returns
The tool

◆ getToolSchemas()

JsonObject agents::tools::ToolRegistry::getToolSchemas ( ) const

Get tool schemas as JSON.

Returns
The tool schemas

◆ global()

static ToolRegistry & agents::tools::ToolRegistry::global ( )
static

Get the global tool registry.

Returns
The global tool registry

◆ hasTool()

bool agents::tools::ToolRegistry::hasTool ( const String & name) const

Check if a tool is registered.

Parameters
nameThe name of the tool
Returns
True if the tool is registered, false otherwise

◆ registerTool()

void agents::tools::ToolRegistry::registerTool ( std::shared_ptr< Tool > tool)

Register a tool.

Parameters
toolThe tool to register

◆ removeTool()

void agents::tools::ToolRegistry::removeTool ( const String & name)

Remove a tool.

Parameters
nameThe name of the tool