MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / annotateToolResultOutcome

Function annotateToolResultOutcome

packages/core/sdk/src/tool-result.ts:97–106  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

95 * attributes. Non-ToolResult values (raw success payloads) annotate "ok".
96 */
97export const annotateToolResultOutcome = (value: unknown): Effect.Effect<void> => {
98 if (isToolResult(value) && !value.ok) {
99 return Effect.annotateCurrentSpan({
100 "executor.tool.outcome": "fail",
101 "executor.tool.error_code": value.error.code,
102 ...(value.error.status != null ? { "executor.tool.error_status": value.error.status } : {}),
103 });
104 }
105 return Effect.annotateCurrentSpan({ "executor.tool.outcome": "ok" });
106};

Callers 1

makeExecutorToolInvokerFunction · 0.90

Calls 1

isToolResultFunction · 0.85

Tested by

no test coverage detected