This is NOT a breaking change.BaseTool is an abstract class that implements the Tool interface — plain object tools continue to work exactly as before. However, they do not support the hooks and policies system introduced in v4 (e.g., HcsAuditTrailHook, MaxRecipientsPolicy, RejectToolPolicy). To enable those features, migrate your tool to BaseTool.
Extending BaseTool splits execution into a 7-stage lifecycle that hooks and policies tap into automatically — you never call them manually. For a detailed step-by-step guide on refactoring your tools, see the Migration Guide.
import type { Tool } from '@/shared/tools';const tool = (context: Context): Tool => ({ method: MY_TOOL, name: 'My Tool', description: myToolPrompt(context), parameters: myToolParameters(context), execute: myToolExecute, // all logic in one function; no hook/policy entry points});export default tool;
The Hedera Agent Kit tools return a structured JSON output. Each tool returns:
{ raw: any; // The raw data returned by the tool (e.g., transaction receipt, query result) humanMessage: string; // A human-readable message describing the result}
This allows you to easily display a user-friendly message while still having access to the raw data for further processing.
To create a plugin to be use with the Hedera Agent Kit, you will need to create a plugin in your own repository, publish an npm package, and provide a description of the functionality included in that plugin, as well as the required and optional parameters.Once you have a repository, published npm package, and a README with a description of the functionality included in that plugin in your plugin’s repo, as well, add it to the Hedera Agent Kit by forking and opening a Pull Request that includes:
Include the name, a brief description, and a link to the repository with the README, as well the URL linked to the published npm package.
If you would like to include your plugin functionality in the Hedera plugin built for ElizaOS simply make a PR to add your plugin name to the plugins array in the Hedera ElizaOS plugin where the configuration is initiated. The hedera-agent-kit adaptor architecture means your plugin functionality will be usable with no additional configuration needed.
Please also reach out in the Hedera Discord in the Support > developer-help-desk channel or create an Issue in this repository for help building, publishing, and promoting your plugin.
## Plugin NameThis plugin was built by <?> for the <project, platform, etc>. It was built to enable <who?> to <do what?>Include a description of your project and how it can be used with the Hedera Agent Kit. ### Installation```bashnpm install <plugin-name>```### Usage```javascriptimport { myPlugin } from '<plugin-name>';``````typescriptimport { AgentMode } from '@hashgraph/hedera-agent-kit';import { myPlugin } from '<plugin-name>';import { HederaLangchainToolkit } from '@hashgraph/hedera-agent-kit-langchain';const toolkit = new HederaLangchainToolkit({ client, configuration: { plugins: [myPlugin], context: { mode: AgentMode.AUTONOMOUS, }, },});const tools = toolkit.getTools();```### FunctionalityDescribe the different tools or individual pieces of functionality included in this plugin, and how to use them.**Plugin Name**_High level description of the plugin_| Tool Name | Description |Usage || ----------------------------------------------- | -------------------------------------------------- |--------------------------------------------------------- || `YOUR_PLUGIN_TOOL_NAME`| What it does | How to use. Include a list of parameters and their descriptions|