mirror of
https://github.com/aljazceru/dvmcp.git
synced 2025-12-17 05:14:24 +01:00
Refactor/clis (#6)
This commit is contained in:
@@ -104,10 +104,18 @@ export class ToolExecutor {
|
||||
|
||||
private createToolRequest(tool: Tool, params: unknown): Event {
|
||||
const request = this.keyManager.createEventTemplate(TOOL_REQUEST_KIND);
|
||||
|
||||
const parameters =
|
||||
!tool.inputSchema.properties ||
|
||||
Object.keys(tool.inputSchema.properties).length === 0
|
||||
? {}
|
||||
: params;
|
||||
|
||||
request.content = JSON.stringify({
|
||||
name: tool.name,
|
||||
parameters: params,
|
||||
parameters,
|
||||
});
|
||||
|
||||
request.tags.push(['c', 'execute-tool']);
|
||||
return this.keyManager.signEvent(request);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user