MCPcopy Index your code
hub / github.com/simstudioai/sim / buildResultData

Function buildResultData

apps/sim/lib/copilot/tools/client/run-tool-execution.ts:543–568  ·  view source on GitHub ↗

* Extract a structured result payload from the raw execution result * for the LLM to see the actual workflow output.

(result: unknown)

Source from the content-addressed store, hash-verified

541 * for the LLM to see the actual workflow output.
542 */
543function buildResultData(result: unknown): Record<string, unknown> | undefined {
544 if (!result || typeof result !== 'object') return undefined
545
546 const r = result as Record<string, unknown>
547
548 if ('success' in r) {
549 return {
550 success: r.success,
551 output: r.output,
552 logs: r.logs,
553 error: r.error,
554 }
555 }
556
557 if ('execution' in r && r.execution && typeof r.execution === 'object') {
558 const exec = r.execution as Record<string, unknown>
559 return {
560 success: exec.success,
561 output: exec.output,
562 logs: exec.logs,
563 error: exec.error,
564 }
565 }
566
567 return undefined
568}
569
570/**
571 * Report tool completion to the server via the existing /api/copilot/confirm endpoint.

Callers 1

doExecuteRunToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected