MCPcopy Create free account
hub / github.com/buct2012dbl/Dorchestrator / executeToolCall

Function executeToolCall

coding-agent/src/agent/base-agent.ts:18–46  ·  view source on GitHub ↗
(toolId: string, args: any)

Source from the content-addressed store, hash-verified

16 abstract process(message: string, onFirstText?: () => void): Promise<string>;
17
18 protected async executeToolCall(toolId: string, args: any): Promise<any> {
19 const session = sessionManager.current();
20
21 emitCliTimelineEvent(createRunningToolEvent(toolId, args || {}));
22
23 await messageBus.publish('tool:execute', { toolId, args }, {
24 sessionId: session.id,
25 agentId: this.config.id
26 });
27
28 const result = await toolRegistry.execute(toolId, args, {
29 sessionId: session.id,
30 agentId: this.config.id,
31 workingDirectory: process.cwd()
32 });
33
34 await messageBus.publish('tool:result', { toolId, result }, {
35 sessionId: session.id,
36 agentId: this.config.id
37 });
38
39 emitCliTimelineEvent(
40 result?.success
41 ? createCompletedToolEvent(toolId, result)
42 : createFailedToolEvent(toolId, result?.error || result)
43 );
44
45 return result;
46 }
47
48 protected getTools() {
49 return toolRegistry.getForAgent(this.config.id, this.config.tools);

Callers

nothing calls this directly

Calls 7

emitCliTimelineEventFunction · 0.85
createRunningToolEventFunction · 0.85
createCompletedToolEventFunction · 0.85
createFailedToolEventFunction · 0.85
currentMethod · 0.80
publishMethod · 0.80
executeMethod · 0.65

Tested by

no test coverage detected