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

Function toToolResult

apps/sim/executor/handlers/pi/sim-tools.ts:24–31  ·  view source on GitHub ↗
(result: ToolResponse)

Source from the content-addressed store, hash-verified

22const logger = createLogger('PiSimTools')
23
24function toToolResult(result: ToolResponse): PiToolResult {
25 if (result.success) {
26 const text =
27 typeof result.output === 'string' ? result.output : JSON.stringify(result.output ?? {})
28 return { text, isError: false }
29 }
30 return { text: result.error || 'Tool execution failed', isError: true }
31}
32
33/**
34 * Builds the Sim tool specs exposed to Pi for a local run. Only tools the user

Callers 1

buildSimToolSpecsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected