|
NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
|
Abstract base class for tools that agents can call. More...
#include <tool.h>
Public Member Functions | |
| virtual std::string | execute (const json &arguments)=0 |
| Execute the tool with the given arguments. | |
| virtual asio::awaitable< std::string > | execute_async (const json &arguments) |
| Canonical async entry point for tool execution. | |
| virtual ChatTool | get_definition () const =0 |
| Get the tool definition metadata. | |
| virtual std::string | get_name () const =0 |
| Get the tool name. | |
Abstract base class for tools that agents can call.
A tool provides its definition (name, description, parameter schema) so the LLM knows when and how to call it, and an execute() method that performs the actual work.
|
pure virtual |
Execute the tool with the given arguments.
| arguments | JSON object containing the tool's input parameters. |
Implemented in neograph::AsyncTool.
|
virtual |
Canonical async entry point for tool execution.
The default offloads the sync execute() implementation to NeoGraph's bounded blocking pool, so a legacy synchronous tool no longer pins the graph event loop or serializes unrelated tool calls. I/O-bound tools (HTTP fetch, MCP RPC) override this with a real coroutine. Dispatchers apply ToolExecutionController policy before calling either path.
Reimplemented in neograph::mcp::MCPTool, and neograph::AsyncTool.
|
pure virtual |
Get the tool definition metadata.
Returns a ChatTool containing the tool's name, description, and JSON Schema for its parameters. This is sent to the LLM so it can decide when to call the tool.
Implemented in neograph::mcp::MCPTool.
|
pure virtual |
Get the tool name.
Implemented in neograph::mcp::MCPTool.