MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / isCodeResult

Function isCodeResult

packages/mcp-server/src/tools.ts:280–288  ·  view source on GitHub ↗
(payload: unknown)

Source from the content-addressed store, hash-verified

278 if (isTempadMcpErrorCode(causeCode)) return causeCode
279 return undefined
280}
281
282function isTempadMcpErrorCode(value: unknown): value is TempadMcpErrorCode {
283 return typeof value === 'string' && KNOWN_ERROR_CODES.has(value)
284}
285
286function extractToolErrorMessage(error: unknown): string {
287 if (error instanceof Error) return error.message || 'Unknown error occurred.'
288 if (typeof error === 'string') return error
289 const message = getRecordProperty(error, 'message')
290 if (typeof message === 'string' && message.trim()) return message
291 return 'Unknown error occurred.'

Callers 1

createCodeToolResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected