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

Function unwrapFunctionExecuteOutput

apps/sim/lib/copilot/request/tools/files.ts:45–52  ·  view source on GitHub ↗
(output: unknown)

Source from the content-addressed store, hash-verified

43 * `user_table` returns `{ data, message, success }` which is left alone.
44 */
45export function unwrapFunctionExecuteOutput(output: unknown): unknown {
46 if (!output || typeof output !== 'object' || Array.isArray(output)) return output
47 const obj = output as Record<string, unknown>
48 if ('result' in obj && 'stdout' in obj) {
49 return obj.result
50 }
51 return output
52}
53
54/**
55 * Try to pull a flat array of row-objects out of an already-unwrapped tool

Callers 2

files.test.tsFile · 0.90
serializeOutputForFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected