mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:00:54 +00:00
23 lines
868 B
TypeScript
23 lines
868 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveOpenClawToolsForMcp } from "./openclaw-tools-serve.js";
|
|
import { createPluginToolsMcpHandlers } from "./plugin-tools-handlers.js";
|
|
|
|
describe("OpenClaw tools MCP server", () => {
|
|
it("does not expose owner-only cron", async () => {
|
|
const handlers = createPluginToolsMcpHandlers(resolveOpenClawToolsForMcp());
|
|
|
|
const listed = await handlers.listTools();
|
|
expect(listed.tools.map((tool) => tool.name)).not.toContain("cron");
|
|
});
|
|
|
|
it("blocks owner-only cron invocation", async () => {
|
|
const handlers = createPluginToolsMcpHandlers(resolveOpenClawToolsForMcp());
|
|
|
|
const result = await handlers.callTool({ name: "cron", arguments: { action: "status" } });
|
|
expect(result).toEqual({
|
|
content: [{ type: "text", text: "Unknown tool: cron" }],
|
|
isError: true,
|
|
});
|
|
});
|
|
});
|