|
Agents 1.4.0
Edge AI Agents SDK
|
Interface for tools that an agent can use. More...
#include <tool.h>
Public Member Functions | |
| MCPTool (const std::string &name, const std::string &description, const mcpConfig &config) | |
| Construct a new MCPTool object. | |
| MCPTool (const std::string &name, const std::string &description, const JsonObject ¶meters, const std::shared_ptr< mcp::client > &client) | |
| Construct a new MCPTool object. | |
| MCPTool (const std::string &name, const std::string &description, const JsonObject ¶meters, const mcpConfig &config) | |
| Construct a new MCPTool object. | |
| ToolResult | execute (const JsonObject ¶ms) const override |
| Execute the MCP tool with the given parameters. | |
| const std::string & | getName () const |
| Get the name of the tool. | |
| const std::string & | getDescription () const |
| Get the description of the tool. | |
| const ParameterMap & | getParameters () const |
| Get the parameters of the tool. | |
| const JsonObject & | getSchema () const |
| Get the schema of the tool. | |
| void | addParameter (const Parameter ¶m) |
| Add a parameter to the tool. | |
| void | addParametersFromJson (const JsonObject ¶ms) |
| Add tool parameters from json definition. | |
| void | setCallback (ToolCallback callback) |
| Set the execution callback. | |
| bool | validateParameters (const JsonObject ¶ms) const |
| Validate parameters against schema. | |
Static Public Member Functions | |
| static std::shared_ptr< mcp::client > | createClient (const mcpConfig &config) |
| Create an MCP client object. | |
Interface for tools that an agent can use.
| agents::MCPTool::MCPTool | ( | const std::string & | name, |
| const std::string & | description, | ||
| const mcpConfig & | config ) |
Construct a new MCPTool object.
| name | The name of the tool |
| description | The description of the tool |
| config | The mcp client config |
| agents::MCPTool::MCPTool | ( | const std::string & | name, |
| const std::string & | description, | ||
| const JsonObject & | parameters, | ||
| const std::shared_ptr< mcp::client > & | client ) |
Construct a new MCPTool object.
| name | The name of the tool |
| description | The description of the tool |
| parameters | The json parameters of the tool |
| client | The mcp client |
| agents::MCPTool::MCPTool | ( | const std::string & | name, |
| const std::string & | description, | ||
| const JsonObject & | parameters, | ||
| const mcpConfig & | config ) |
Construct a new MCPTool object.
| name | The name of the tool |
| description | The description of the tool |
| parameters | The json parameters of the tool |
| config | The mcp client config |
|
inherited |
Add a parameter to the tool.
| param | The parameter to add |
|
inherited |
Add tool parameters from json definition.
| params | The parameters to add |
|
static |
Create an MCP client object.
| server_name | mcp client name |
| config | mcp client config |
|
overridevirtual |
Execute the MCP tool with the given parameters.
| params | The parameters to execute the tool with |
Reimplemented from agents::Tool.
|
inherited |
Get the description of the tool.
|
inherited |
Get the name of the tool.
|
inherited |
Get the parameters of the tool.
|
inherited |
Get the schema of the tool.
|
inherited |
Set the execution callback.
| callback | The callback to set |
|
inherited |
Validate parameters against schema.
| params | The parameters to validate |