|
Entropic 2.3.8
Local-first agentic inference engine
|
Manages a collection of ToolBase instances. More...
#include <entropic/mcp/tool_registry.h>
Public Member Functions | |
| void | register_tool (ToolBase *tool) |
| Register a tool instance. | |
| bool | has_tool (const std::string &name) const |
| Check if a tool is registered by name. | |
| std::string | get_tools_json () const |
| Get all registered tool definitions as a JSON array string. | |
| std::vector< const ToolDefinition * > | get_definitions () const |
| Get all registered tool definitions. | |
| ServerResponse | dispatch (const std::string &name, const std::string &args_json) |
| Dispatch a tool call to the registered tool's execute(). | |
| ToolBase * | get_tool (const std::string &name) const |
| Get a registered tool by name. | |
Manages a collection of ToolBase instances.
Replaces the dict-dispatch boilerplate repeated across servers. Servers call register_tool() during construction and the registry handles get_tools() and dispatch() automatically.
Definition at line 31 of file tool_registry.h.
| ServerResponse entropic::ToolRegistry::dispatch | ( | const std::string & | name, |
| const std::string & | args_json | ||
| ) |
Dispatch a tool call to the registered tool's execute().
Dispatch a tool call to the registered tool.
| name | Tool name. |
| args_json | JSON arguments string. |
| name | Tool name. |
| args_json | JSON arguments string. |
Definition at line 90 of file tool_registry.cpp.
| std::vector< const ToolDefinition * > entropic::ToolRegistry::get_definitions | ( | ) | const |
Get all registered tool definitions.
Definition at line 73 of file tool_registry.cpp.
| ToolBase * entropic::ToolRegistry::get_tool | ( | const std::string & | name | ) | const |
Get a registered tool by name.
| name | Tool name. |
| name | Tool name. |
Definition at line 111 of file tool_registry.cpp.
| std::string entropic::ToolRegistry::get_tools_json | ( | ) | const |
Get all registered tool definitions as a JSON array string.
Get all registered tool definitions as JSON array.
Definition at line 54 of file tool_registry.cpp.
| bool entropic::ToolRegistry::has_tool | ( | const std::string & | name | ) | const |
Check if a tool is registered by name.
| name | Tool name. |
| name | Tool name. |
Definition at line 44 of file tool_registry.cpp.
| void entropic::ToolRegistry::register_tool | ( | ToolBase * | tool | ) |
Register a tool instance.
| tool | Non-owning pointer to a ToolBase. Caller retains ownership. |
| tool | Non-owning pointer to a ToolBase. |
Definition at line 24 of file tool_registry.cpp.