MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / handleToolEnd

Method handleToolEnd

packages/components/src/handler.ts:2006–2018  ·  view source on GitHub ↗

* Handle the end of a tool invocation

(output: string | object, runId: string, parentRunId?: string)

Source from the content-addressed store, hash-verified

2004 * Handle the end of a tool invocation
2005 */
2006 async handleToolEnd(output: string | object, runId: string, parentRunId?: string): Promise<void> {
2007 if (!this.sseStreamer) return
2008
2009 const toolOutput = typeof output === 'string' ? output : JSON.stringify(output, null, 2)
2010
2011 // Stream the tool output details using the agent_trace event type for consistency
2012 this.sseStreamer.streamCustomEvent(this.chatId, 'agent_trace', {
2013 step: 'tool_end',
2014 output: toolOutput,
2015 runId,
2016 parentRunId: parentRunId || null
2017 })
2018 }
2019
2020 /**
2021 * Handle tool errors

Callers 6

callMethod · 0.80
callMethod · 0.80
callMethod · 0.80
callMethod · 0.80
callMethod · 0.80
callMethod · 0.80

Calls 2

stringifyMethod · 0.80
streamCustomEventMethod · 0.65

Tested by

no test coverage detected