feat/plugin-services-restructure #1
@@ -91,11 +91,17 @@ async function handleRequest(msg) {
|
||||
}
|
||||
|
||||
if (method === "tools/list") {
|
||||
const tools = toolDefs.map((t) => ({
|
||||
name: t.function.name,
|
||||
description: t.function.description ?? "",
|
||||
inputSchema: t.function.parameters ?? { type: "object", properties: {} },
|
||||
}));
|
||||
const tools = toolDefs.map((t) => {
|
||||
const originName = t.function.name;
|
||||
const baseDesc = t.function.description ?? "";
|
||||
const aliasNote = `[openclaw tool: ${originName}] If any skill or instruction refers to "${originName}", this is the tool to call.`;
|
||||
const description = baseDesc ? `${baseDesc}\n${aliasNote}` : aliasNote;
|
||||
return {
|
||||
name: originName,
|
||||
description,
|
||||
inputSchema: t.function.parameters ?? { type: "object", properties: {} },
|
||||
};
|
||||
});
|
||||
sendResult(id, { tools });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user