NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::Tool Class Referenceabstract

Abstract base class for tools that agents can call. More...

#include <tool.h>

Inheritance diagram for neograph::Tool:
[legend]

Public Member Functions

virtual std::string execute (const json &arguments)=0
 Execute the tool with the given arguments.
 
virtual ChatTool get_definition () const =0
 Get the tool definition metadata.
 
virtual std::string get_name () const =0
 Get the tool name.
 

Detailed Description

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.

See also
neograph::mcp::MCPTool for remote MCP server tools.

Definition at line 28 of file tool.h.

Member Function Documentation

◆ execute()

virtual std::string neograph::Tool::execute ( const json &  arguments)
pure virtual

Execute the tool with the given arguments.

Parameters
argumentsJSON object containing the tool's input parameters.
Returns
Result string to be fed back to the LLM.

Implemented in neograph::AsyncTool, and neograph::mcp::MCPTool.

◆ get_definition()

virtual ChatTool neograph::Tool::get_definition ( ) const
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.

Returns
Tool definition including name, description, and parameter schema.

Implemented in neograph::mcp::MCPTool.

◆ get_name()

virtual std::string neograph::Tool::get_name ( ) const
pure virtual

Get the tool name.

Returns
Tool name string (must match the name in get_definition()).

Implemented in neograph::mcp::MCPTool.


The documentation for this class was generated from the following file: