chore: openclaw plugins init tools

This commit is contained in:
openclaw committed 2026-10-13 05:38:03 +00:00
commit bb367eb952
7 files changed
+120

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import { describe, expect, it } from "vitest";
import entry from "./index.js";
import { getToolPluginMetadata } from "openclaw/plugin-sdk/tool-plugin";
describe("tools", () => {
it("declares tool metadata", () => {
expect(getToolPluginMetadata(entry)?.tools.map((tool) => tool.name)).toEqual(["echo"]);
});
});
+18
View File
@@ -0,0 +1,18 @@
import { Type } from "typebox";
import { defineToolPlugin } from "openclaw/plugin-sdk/tool-plugin";
export default defineToolPlugin({
id: "tools",
name: "Tools",
description: "Add Tools tools to OpenClaw.",
tools: (tool) => [
tool({
name: "echo",
description: "Echo input text.",
parameters: Type.Object({
input: Type.String({ description: "Text to echo." }),
}),
execute: async ({ input }) => ({ input }),
}),
],
});