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

Function requireToolCallError

apps/sim/lib/copilot/request/tool-call-state.ts:47–57  ·  view source on GitHub ↗
(
  toolCall: Pick<ToolCallState, 'id' | 'status' | 'error'>
)

Source from the content-addressed store, hash-verified

45}
46
47export function requireToolCallError(
48 toolCall: Pick<ToolCallState, 'id' | 'status' | 'error'>
49): string {
50 if (typeof toolCall.error === 'string' && toolCall.error.length > 0) {
51 return toolCall.error
52 }
53
54 throw new Error(
55 `Terminal tool call ${toolCall.id} is missing a canonical error for status ${toolCall.status}`
56 )
57}
58
59export function getToolCallTerminalData(
60 toolCall: Pick<ToolCallState, 'id' | 'status' | 'result' | 'error'>

Callers 4

getToolCallTerminalDataFunction · 0.85
setTerminalToolCallStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected