MCPcopy Create free account
hub / github.com/MemTensor/MemOS / registerTool

Function registerTool

apps/memos-local-openclaw/tests/plugin-impl-access.test.ts:24–37  ·  view source on GitHub ↗
(def: any, meta?: { name?: string })

Source from the content-addressed store, hash-verified

22 warn: () => {},
23 },
24 registerTool(def: any, meta?: { name?: string }) {
25 if (typeof def === "function") {
26 const key = meta?.name ?? def({ agentId: "main", sessionKey: "default" }).name;
27 tools.set(key, {
28 name: key,
29 execute: (...args: any[]) => {
30 const runtimeCtx = args[2] ?? { agentId: "main", sessionKey: "default" };
31 return def(runtimeCtx).execute(...args);
32 },
33 });
34 return;
35 }
36 tools.set(def.name, def);
37 },
38 registerMemoryPromptSection() {},
39 registerMemoryCapability() {},
40 registerService(def: any) {

Callers

nothing calls this directly

Calls 1

setMethod · 0.65

Tested by

no test coverage detected