MCPcopy Create free account
hub / github.com/Effect-TS/effect / encodeResult

Function encodeResult

packages/effect/src/unstable/ai/Toolkit.ts:337–350  ·  view source on GitHub ↗
(result: any)

Source from the content-addressed store, hash-verified

335 )
336
337 const encodeResult = (result: any) =>
338 schemas.encodeResult(result).pipe(
339 Effect.mapError((cause) =>
340 AiError.make({
341 module: "Toolkit",
342 method: `${name}.handle`,
343 reason: new AiError.ToolResultEncodingError({
344 toolName: name,
345 toolResult: result,
346 description: cause.message
347 })
348 })
349 )
350 )
351
352 const normalizeError = (error: unknown) => {
353 // Schema errors indicate handler returned invalid data

Callers 1

Toolkit.tsFile · 0.85

Calls 2

pipeMethod · 0.65
makeMethod · 0.65

Tested by

no test coverage detected