MCPcopy Create free account
hub / github.com/Noumena-Network/code / formatModelToolResult

Function formatModelToolResult

src/tools/REPLTool/pyReplFactory.tsx:251–272  ·  view source on GitHub ↗
(output: PythonReplToolOutput)

Source from the content-addressed store, hash-verified

249}
250
251function formatModelToolResult(output: PythonReplToolOutput): string {
252 const lines: string[] = []
253 lines.push(output.error ? 'Python REPL execution failed.' : 'Python REPL execution completed.')
254
255 if (output.toolCalls.length > 0) {
256 lines.push(`Inner tool calls (${output.toolCalls.length}):`)
257 for (const call of output.toolCalls) {
258 lines.push(`- ${formatToolCallSummary(call)}`)
259 }
260 } else {
261 lines.push('Inner tool calls: none')
262 }
263
264 if (output.output.trim().length > 0) {
265 lines.push(`output:\n${preview(output.output)}`)
266 }
267 if (output.error) {
268 lines.push(`error:\n${output.error}`)
269 }
270
271 return lines.join('\n\n')
272}
273
274function renderProgressHint(data: ReplToolCallProgress): string {
275 if (data.phase !== 'start') {

Callers 1

Calls 2

formatToolCallSummaryFunction · 0.70
previewFunction · 0.70

Tested by

no test coverage detected