|
Agents 1.4.0
Edge AI Agents SDK
|
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< Tool > | getTool (const std::string &name) const |
| Get a tool by name. | |
| std::vector< std::shared_ptr< Tool > > | getAllTools () const |
| Get all registered tools. | |
| bool | hasTool (const std::string &name) const |
| Check if a tool is registered. | |
| void | removeTool (const std::string &name) |
| Remove a tool. | |
| void | clear () |
| Clear all tools. | |
| JsonObject | getToolSchemas () const |
| Get tool schemas as JSON. | |
| void | registerStandardTools (const std::shared_ptr< LLMInterface > llm=nullptr, const std::vector< mcpConfig > mcpConfig={}) |
| Create and register standard tools. | |
Static Public Member Functions | |
| static ToolRegistry & | global () |
| Get the global tool registry. | |
Registry for tools that agents can use.
The ToolRegistry provides a central place to register, retrieve, and manage tools that agents can use.
| std::vector< std::shared_ptr< Tool > > agents::tools::ToolRegistry::getAllTools | ( | ) | const |
Get all registered tools.
| std::shared_ptr< Tool > agents::tools::ToolRegistry::getTool | ( | const std::string & | name | ) | const |
Get a tool by name.
| name | The name of the tool |
| JsonObject agents::tools::ToolRegistry::getToolSchemas | ( | ) | const |
Get tool schemas as JSON.
|
static |
Get the global tool registry.
| bool agents::tools::ToolRegistry::hasTool | ( | const std::string & | name | ) | const |
Check if a tool is registered.
| name | The name of the tool |
| void agents::tools::ToolRegistry::registerStandardTools | ( | const std::shared_ptr< LLMInterface > | llm = nullptr, |
| const std::vector< mcpConfig > | mcpConfig = {} ) |
Create and register standard tools.
| llm | Optional LLM interface for tools that require it |
| mcpConfig | Optional config of the MCP server |
| void agents::tools::ToolRegistry::registerTool | ( | std::shared_ptr< Tool > | tool | ) |
Register a tool.
| tool | The tool to register |
| void agents::tools::ToolRegistry::removeTool | ( | const std::string & | name | ) |
Remove a tool.
| name | The name of the tool |